Sie sind auf Seite 1von 9

TITLE: Fourier Transform OBJECTIVES: 1.

To learn how to plot the amplitude and the phase spectrums of a signal based on Fourier series and Fourier Transform representation. 2. To learn how to represent non periodic signals in terms of Fourier Transform. 3. To verify the Fourier Transform of the signal in MATLAB. RESULTS: Experiment 1: Amplitude and Phase Spectrum Calculation

Coding

n=30; f=0; t=linspace (-5, 5, 1000); for k=1:n f=f+(4*sin(k*pi/2).*cos(k*pi*t/2))/(k*pi); if k==n f1=1; y=f+f1; end end figure(1),plot(t,y); title('Amplitude Fourier Series'); xlabel('Time(t)');ylabel('x(t)'); amplitude=zeros(1,k); phasor=zeros(1,k); for k1=1:n; c=(2*sin(k1*pi/2))/(k1*pi); amplitude(k1)=abs(c); phasor(k1)=angle(c); end figure(2) subplot(2,1,1),stem(amplitude) title('Amplitude');xlabel('Time(t)');ylabel('x(t)'); subplot(2,1,2),stem(phasor) title('Phasor'),xlabel('Time(t)');ylabel('x(t)');

Amplitude Fourier Series 2.5

1.5

x(t)

0.5

-0.5 -5

-4

-3

-2

-1

0 Time(t)

Figure 1
Amplitude 0.8 0.6 x(t) 0.4 0.2 0

10

15 Time(t) Phasor

20

25

30

4 3 x(t) 2 1 0

10

15 Time(t)

20

25

30

Figure 2

Experiment 2: Fourier Transform Calculation

Coding

w=linspace (0.1,20,200); %amp=zeros (1,200); %pha = zeros (1,200); for s=1:200; x=(sin(w(s)/2))/(w(s)/2); amp(s)= abs(x); pha(s)=angle(x); end subplot(2,1,1),plot (w,amp); title ('Amp and phase spectrum of fourier transform in plot Function'); xlabel('freq(rad/s)'); ylabel('amplitude'); grid on; subplot(2,1,2),plot (w,pha); xlabel('freq(rad/s)'); ylabel('phase'); grid on;

Amp and phase spectrum of fourier transform in plot Function 1

amplitude

0.5

10 12 freq(rad/s)

14

16

18

20

4 3 phase 2 1 0

10 12 freq(rad/s)

14

16

18

20

Figure 3 QUESTION: 1. Why do you use stem command instead of plot in plotting the spectrums of a periodic signal? We have been used stem command instead of plot in plotting the spectrums of a periodic signal because we want to plot the magnitude and angle of the coeffients.

DISCUSSION: Lab Session 3 experiments is about Fourier Transform. Fourier Transform assigns a frequency function X (), the so- called spectral function, to a time function x (t). If the time function is periodically an unlimited in the time domain, such that x (t) = x (t + T) where T donates the periodic, the function x (t) can be developed into an infinite series of sine and cosine term. For experiment 1, a periodic pulse signal is given at the Figure 3.1. From the Figure given, the Fourier series representation of the signal is finding using the calculation. The calculation can be defined by using this equation:

This equation is known as the Fourier series of x (t). The term with the frequency = 2/ T is called first harmonic (basic oscillation). All other terms, the frequencies of which are integer multiples of the basic frequency, are called higher harmonics. After done the equation, the Fourier series can be plotted using the MATLAB and as the result, Figure 1 and Figure 2 are identified. During the MATLAB, we have been using the abs and angle command to calculate the magnitude and angle for each coefficient. While stem is used instead of plot command is to plot the magnitude and angle of the coefficients and the subplot is used to plot both spectrums in one figure. For experiment 2, a rectangular pulse signal is given at Figure 3.2. From the Figure given, the Fourier Transform representation of the signal is finding using the calculation. The Fourier Transform extends this concept of a frequency spectral to non-periodic functions or signals. The Fourier Transform of non periodic signal x (t) is given by:

The function X () is the spectrum of x (t). The amplitude of X () is the double- sided amplitude- density spectrum (called amplitude spectrum) of x (t). The angle of X () is the double- sided phase spectrum of x (t). During the MATLAB, the magnitude and phase spectrum of the signal is plotted for frequency limit between 0.1 to 29 radians/ seconds with 200 sample and the abs and angle command have been used to calculate the magnitude and angle for each coefficient. Mean while the subplot is used to plot both spectrums in one figure.

CONCLUSION: At the end of this lab session, we learn how to plot the amplitude and the phase spectrums of a signal based on Fourier series and Fourier Transform representation. We also learn how to represent non periodic signals in terms of Fourier Transform. In this lab session we can also know how to verify the Fourier Transform of the signal in MATLAB.

After finishing this lab session, we found that the objectives of this lab session have been achieved successfully.

Das könnte Ihnen auch gefallen