The DTFT X(
frequency variable
each frequncy sample, where X[k] = X(
As an example consider a windowed sinusoid
Define rect().
Set the width
To use the Discrete Fourier Transform, the signal must first be sampled.
The sampled signal is defined as xs(n), where n is the time-domain sample index,
where the DFT is Xs(k),
and indices k and n go from 0 to npts-1, where npts is the number of sample points.
Ts is the sampling time period.
tmax sets the time window over which the sampling is done (-tmax to tmax).
set the sampling window to twice the length of the window
Set sampling time Ts to be much less than one cycle
of the carrier frequency
Sampling frequency=Fs Hertz.
Set number of points to a power of two.
(The equation is a bit cumbersome.)
initialize the time and frequency indices, n and k
Finally, xs
It is a vector consisting of the value of x(t) at
npts equally spaced time intervals, spaced Ts apart.
Next, compute the DFT using the formula below instead of
the Mathcad built-in FFT
Next, zoom in on the low frequencies:
Lets just plot up to n=nmax, in the plot below
Recall, the frequency index k corresponds to discrete time frequency steps
of
of
Below, the frequency axis is converted to discrete-time frequency
ranges from 0 to 2
The DFT
Let X denote the N-point frequency domain column vector, let x denote the N-point time domain column vector, and let F denote the NxN Fourier matrix.
Then, the DFT may be rewritten as
As an example consider a 4-point fourier transform,
where the sampled discrete-time data is x = {1, 1, 1, 1}.
Define indices m and n for the rows and columns of the matrix F,
and define F from those two indices:
Finally, compute the DFT
Note that the result is a DC spectrum,
consisting only of X[0]=1,
with all other frequencies X[1]=X[2]=X[3]=0.
The inverse Fourier transform is then another matrix equal to the inverse of F:
Checking the inverse Fourier matrix:
take to compute the product of the fourier matrix F times the time vector x?
The 2-sided z transform is defined for the discrete time sequence
x[n] as X(z) given below
Note: the 2-sided z-transform is incomplete
unless accompanied by the ROC (region of convergence) specification.
For finite length nonzero sequence, the limits become finite.
If x(n) is a vector in Mathcad holding the samples, the equation is rewritten as:
The inverse z-transform is the following closed contour integral in the
region of convergence of the z-plane :
The DTFT is related to the z-transform by
X(
Hence, the DTFT is
So, the DC response is at z-1, and the highest frequency of
corresponds to z = -1.
First,
use the Mathcad z-transform function to take the z-transform of your sampled data.
The function must be represented as a function of the time variable, n.
Note: it appears that the built-in z-transform is a one-sided z-transform,
and ssumes thet the function equals zero for n < 0.
This z-transform result shows that the function is the
one-sided z-transform since
Quite often the function does not seen to work well,
in some editions of Mathcad the following z-transform results
in
as seen below:
Note:
Instead of using the Mathcad built-in z-transform,
use the following method for finite sequences.
Suppose the sequence is causal and finite, and can be represented as a vector x,
then the z-transform becomes:
An example:
and another example
to find the z-transform symbolically.
Instead of using the Mathcad built-in inverse z-transform,
use the following method.
Most commonly, inverse z-transform of closed form type is done by a
look-up table, just as for Laplace transform.
The following method is a numerical implementstion of the inverse z-transform integral
where xn is x[n].
To simplify the integral a bit, let us choose a contour as a circle of radius r in the
z-plane, and rotate the angle
Repeating the example from before:
and checking out z-trsnsform at a radius of 10.
(assuming a stable system, as is obvious since the sequence is finite length)
whether the inverse z-transform results at the left
are still correct?.
In some editions of Mathcad, the symbolic expansion of H(z) will not evaluate properly below
if the elements of a and b are decimal (i.e., 0.5) instead of integer rational fractions (i.e., 1/2).
Before plotting, prevent divide by zero and set poles to "maxplot" height
Poles and Zeroes of H(z):
Click on the plot to rotate it,
double-click to experiment with settings
Red x-xis=Re(z), Green y-axis = Im(z), z-axis = |H(z)|
and the pole-zero plot
Lets plot a unit circle too
Define a new inverse z-transform, since the above H(z) does not have an argument (i.e.,H(x,z))
as was required in the firs inverse z-transform we defined
If the first form does not converge, use the approximation below.
The causal right-sided sequence is found using the inverse z-transform with
ROC outside the poles, here we choose the circular contour at radius r=10 in
the z-plane for inverse z-transform:
Check our approximation.
The non-causal left-sided sequence is found using the inverse z-transform with
ROC inside the poles, here we choose the circular contour at radius r=0.1 in
the z-plane for inverse z-transform:
Check our approximation.
or neither