0% found this document useful (0 votes)
81 views3 pages

Lab 08: Fourier Transform

1) The document describes a signals and systems lab on the Fourier transform. It demonstrates taking the FFT of a cosine signal using different values for N and shows that the resulting transforms have the same shape but differ in resolution. 2) The lab then finds the frequency response and impulse response of a given system. It shows the steps to obtain the transfer function H(s) from the system function, find the poles and zeros, and multiply the transfer functions to obtain the output Y(s) for a given input X(s). 3) MATLAB commands are provided to calculate the transfer function, poles and zeros, and impulse response for the example system directly from the code, validating the manual calculation process.

Uploaded by

saran gul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views3 pages

Lab 08: Fourier Transform

1) The document describes a signals and systems lab on the Fourier transform. It demonstrates taking the FFT of a cosine signal using different values for N and shows that the resulting transforms have the same shape but differ in resolution. 2) The lab then finds the frequency response and impulse response of a given system. It shows the steps to obtain the transfer function H(s) from the system function, find the poles and zeros, and multiply the transfer functions to obtain the output Y(s) for a given input X(s). 3) MATLAB commands are provided to calculate the transfer function, poles and zeros, and impulse response for the example system directly from the code, validating the manual calculation process.

Uploaded by

saran gul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Signals and Systems Lab DEE, FURC

Lab 08: Fourier Transform

Program 1

FFT and the effect of changing the value of N.


Using the Fast Fourier Transform (FFT) to approximate the Fourier Series

Example 1: The typical syntax for computing the FFT of a signal is FFT(x,N) where x is
the signal, x[n], you wish to transform, and N is the number of points in the FFT. N must
be at least as large as the number of samples in x[n]. To demonstrate the effect of
changing the value of N, sythesize a cosine signal with 30 samples at 10 samples per
period.

n = [0:29];
x = cos(2*pi*n/10);

Define 3 different values for N and take the transform of x[n] for each of these 3 values.
The abs function finds the magnitude of the transform, as we are not concerned with
distinguishing between real and imaginary components.

N1 = 64;
N2 = 128;
N3 = 256;
X1 = abs(fft(x,N1));
X2 = abs(fft(x,N2));
X3 = abs(fft(x,N3));

The frequency scale begins at 0 and extends to N - 1 for an N-point FFT. We then
normalize the scale so that it extends from 0 to 1-1/N.

F1 = [0 : N1 - 1]/N1;
F2 = [0 : N2 - 1]/N2;
F3 = [0 : N3 - 1]/N3;

figure(1);
subplot(3,1,1)
plot(F1,X1,'-x'),title('N = 64'),axis([0 1 0 20])
subplot(3,1,2)
plot(F2,X2,'-x'),title('N = 128'),axis([0 1 0 20])
subplot(3,1,3)
plot(F3,X3,'-x'),title('N = 256'),axis([0 1 0 20])

1
Signals and Systems Lab DEE, FURC

Upon examining the plot (shown in figure 2) one can see that each of the transforms
adheres to the same shape, differing only in the number of samples used to approximate
that shape. What happens if N is the same as the number of samples in x[n]? To find out,
set N1 = 30. What does the resulting plot look like?

N4=30;
X4=abs(fft(x,N4));
F4 = [0 : N4 - 1]/N4;
figure(2);
plot(F4,X4,'-x'),title('N = 30'),axis([0 1 0 20])

Program 2

Finding frequency response and impulse response of a given function

y[n]-3/4y[n-1]+1/8y[n-2]=x[n]

1. find the H(W)=Y(W)/X(W) by calculation using furrier transform ”Y(W)-3/4exp(-


jw)Y(W)+1/8exp(-j2w)Y(W)=X(W) H(W)=1/(1-3/4exp(-jw)+1/8exp(-j2w)) ”

2. assume s=exp(-jw), substitute ‘s’ in H(W); “H(W)=1/(1-3/4s+1/8s^2)”

3. arrange H(W)numerator and denominator by degree “H(W)=1/(1/8s^2-3/4s+1)”

4. find num and den as below;

num = 1; %numerator coefficients


den = [0.125 -0.75 1]; %denominator coefficients

5. H = tf(num,den)

6. Now to find the roots of the numerator and the denominator we can use the
command below; these steps will help us to find the impulse response.

[z,p,k] = tf2zp(num,den) %z=zeros, p=poles, k=gain


[r,p,k] = residue(num,den)

2
Signals and Systems Lab DEE, FURC

7. Finally to find Y(W) for a given X(W), we need to multiply the X(W) with H(W)
that we found previously. Consider X(W)= 1/(0.4s+1), firstly we need to find the
transfer function for X and then multiply that by H.

X = tf([1],[0.4 1])
Y=H*X

8. And to find the impulse response, we can use the conversion table, to convert the
frequency response signal from frequency to time domain impulse response.
a
 ae bt u (t )
1  bs

Answer (using command window):

>> num=1; den=[1/8 -3/4 1]; H = tf(num,den)

>> [z,p,k] = tf2zp(num,den)

>> [r,p,k] = residue(num,den)

>> X=1; Y=X*H;

>> X= tf([1],[0.4 1]); Y=X*H

So, by using Matlab we proved that the result was the same with the one we found by
calculation. The example here was an easy function that could be done easily by
calculation, in the case of complex functions, we can simply use the commands stated
above to find the roots and so finally the 'h' in time domain.

You might also like