Fourier transform. Spectral analysis brief theoretical review fourier analysis


THE FAST FOURIER TRANSFORM (FFT). SPECTRUM ANALYSIS WITH FFT AND MATLAB


Download 150 Kb.
bet4/6
Sana09.01.2023
Hajmi150 Kb.
#1085460
1   2   3   4   5   6
Bog'liq
LW3 FFT

THE FAST FOURIER TRANSFORM (FFT). SPECTRUM ANALYSIS WITH FFT AND MATLAB
The fast Fourier transform (FFT) is simply a class of special algorithms which implement the discrete Fourier transform with considerable savings in computational time. It must be pointed out that the FFT is not a different transform from the DFT, but rather just a means of computing the DFT with a considerable reduction in the number of calculations required.
The typical syntax for computing 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].
Let us generate sine curve within Matlab using the following commands:
Fs = 100; % sampling rate
Ts = 1/Fs; %sampling time interval, Time increment per sample
T=1;
t = 0:Ts:T; %time range
fo = 4; %frequency of the sine wave, 4Hz component
Fmax=1/Ts; %maximum frequency
df=1/T; %Frequency increment
f=0:df:Fmax; %Frequency range (Vector of frequency)
Length of a frequency vector: nf=length(f);
y = 2*sin(2*pi*fo*t); %the sine curve
Plot the sine curve in the time domain
figure(1)
plot(t,y),grid on
title('Sine Wave')
xlabel ('time (sec)')
ylabel ('output signal Y(t)')

Thus, we obtain



Figure 3 Sine wave signal

Let us use MATLAB’s built in fft command to try to recreate the frequency spectrum.


X=fft(y); %Discrete Fourier Transform
Ampl=abs(X); %use abs command to get the magnitude
figure(2)
stem(f,Ampl),grid on
xlabel('Sample Number')
ylabel('Amplitude')
title('Using the Matlab fft command')

Figure 4 Fourier transform of a signal
The FFT contains information between 0 and fs, however, we know that the sampling frequency must be at least twice the highest frequency component. Therefore, the signals spectrum should be entirely below fs/2, the Nyquist frequency.
Recall also, that a real signal should have a transform magnitude that is symmetrical for positive and negative frequencies. Thus, instead of having a spectrum that goes from 0 to fs, it would be more appropriate to show the spectrum from -fs/2 to fs/2. This can be accomplished by using Matlab’s fftshift function as the following code demonstrates.
fn=-Fmax/2:df:Fmax/2; % Normalized frequency axis
Xshift=fftshift(X);
AmplShift=abs(Xshift);
figure(3)
stem(fn,AmplShift),grid on
xlabel('Freq (Hz)')
ylabel('Amplitude')
title('Using the centeredFFT function')

Figure 5 Centered signal via fftshift command
In order to define Amplitude and phase of FFT signal he following syntax is used:
ReX0 = real(Xshift);
ImX0 = imag(Xshift);
The simulation results are represented below.

Figure 6 Amplitude and Phase for FFT of a signal
It is necessary to define some distinctive properties of Fourier Transform.
Firstly, if the signal y(t) is even then the following evenness conditions for spectrum Y( f ) come true:

where an asterisk defines complex conjugate component. It is seen that even signal possesses with even amplitude function, and phase is an odd function.
Secondly, if the signal is a real and even function of time
,
then the following conditions preserve truth for spectrum

Here the imaginary part of the spectrum is equal to zero.
Thirdly, if the signal is the real and odd function of time
,
Then the following conditions come true

In this case, the real part of the spectrum is equal to zero.



Download 150 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling