We will be using the Matlab fft command for this question FF

We will be using the Matlab fft() command for this question. FFT stands for Fast Fourier Transform and it is an algorithm used to calculate the Fourier transform of a discrete signal. FFT is out of scope for this course. But using a small enough sampling interval we can use FFT to calculate (approximate) the Fourier transform of continuous signals. As we observed in the case of conv() function, FFT also assume sampling indexes to be 0, 1, 2, etc.. Hence when FFT is used we need to divide the result by the length of the vector resulting from the fft command to correct the amplitude of the FFT. Plot a 50 Hz 1 volt, zero phase voltage waveform over 5 cycles using a sampling Frequency of 1000 Hz. Divide the figure area into 2 and use the top half for the 3 time domain plots (all 3 in top subplot) resulting from part (a)-(c) Given the period, determine the length of 5 cycles. Then using the sampling interval (1/sampling frequency), create the time base (that is an array of time values over which the waveform is to be plotted) for the signal. Show your working in the report.

Solution

Generate a wave using:

Ts = 1msec, A = 1 V, fo = 50 Hz

Ts=.001;

A=1;

f0=50;

y = A * sin ( 2*pi*fo*t )+ 0.2*randn ( 1, length ( t ) );

Y = fft ( y, 512 ) ; // You can use a 512-point FFT for better resolution

plot ( Y )

plot ( abs ( Y ) ) // You can plot the magnitude of the FFT by using MatLab\'s abs function

plot ( abs ( fftshift ( Y ) ) ) //Plot the magnitude using the fftshift function to move the dc component to the center of the display

L = length ( Y );

x = 100 * ( ( 0 : L-1 ) / L - .5 );

plot ( x, fftshift ( abs ( Y ) ) )

f = 100 * ( ( 0 : L/2-1 ) / L ) ;

Y = fft ( y, 512 ) ;

plot ( f, abs ( Y ( 1 : L/2 ) )

plot ( f, 20 * log10 ( abs ( Y ( 1 : L/2 ) ) ) )  //You can also use a logarithmic scale for the magnitude of spectra. To see the magnified data of magnitude

 We will be using the Matlab fft() command for this question. FFT stands for Fast Fourier Transform and it is an algorithm used to calculate the Fourier transfo

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site