Question

Choose a function of the form sin(2πnx/L) for some “large” integer frequency n and length L....

Choose a function of the form sin(2πnx/L) for some “large” integer frequency n and length L. (What is the Fourier transform of your function?) Uniformly sample the wave with an increment of ∆ over the range [0,L] and take the FFT of the sampled data. Start with a value of ∆ that allows for two or three samples. What frequencies are returned by the FFT? What can you say about how the FFT output changes as ∆ decreases?

please by using matlab

0 0
Add a comment Improve this question Transcribed image text
Answer #1

close all
clear
clc

%% properties of sinusoid signal of the form x(t) = sin(2*pi*f*(t/L))
f = 40; %Hz -->some large integer frequency of x(t)

%% %ALTER THIS VALUE (sampling time Ts) TO CHANGE THE SAMPLING FREQUENCY (Fs = 1/Ts)
Ts = 0.001; %dt in s
%%

Fs = 1/Ts; %Hz -->sampling frequency of signal
L = 10; %maximum duration or length of the signal
t = 0:Ts:L-Ts; %duration of signal
A = 1; %-->Amplitude of signal
p = 0; %phase angle of signal

%%
x = A*sin(2*pi*f*t + p); % sinusoid x(t) = sin(2*pi*f*(t/L))

%% Performing FFT on x(t)
fftlength = 2^nextpow2(length(x));
ffft_one_sided_length = fftlength/2;
ffft = fft(x,fftlength); %applying Matlab inbuilt function fft
ffft_normalised = ffft./(max(ffft));
ffft_shift = fftshift(ffft);
ffft_one_sided_normalised = A.*ffft_normalised(1:ffft_one_sided_length);
fft_freq_x_axis_one_sided = Fs*(0:ffft_one_sided_length-1)/fftlength;

%% plotting x(t) and its fft
figure
subplot(3,1,1)
%% plotting sinusoid signal x(t)
plot(t,x)
title(['x(t) with Fs = ' num2str(Fs) 'Hz, f = ' num2str(f) 'Hz'])
xlabel('Time, t [s]')
ylabel('Amplitude, A')
grid on

subplot(3,1,2)
plot(abs(ffft))
title(['fft with Fs = ' num2str(Fs)])
grid on

subplot(3,1,3)
plot(fft_freq_x_axis_one_sided,abs(ffft_one_sided_normalised))
title('normalised and single-sided fft of x(t)')
xlabel('frequency [Hz]')
ylabel('Amplitude, A')
grid on

--------------------------------------------------------------------------------------------------

explaining the behavior of the fft...
------------------------------consider the normalised (and single sided) graphs of fft -----------------------------------------------------------
for the first graphs (with lower Fs), the original signal is indistinguishable -> fft gives different results for the same signal x(t)
this is the aliasing problem where signals with higher frequency are manifesting themselves as having lower frequency that are recovered by fft
all the fft that applied a lower sampling frequency Fs could not recover the frequency f of the original signal (40Hz)
until Fs was increased to a value equal to atleast than twice f (until Fs>=80) since f is the highest frequency of the x(t)
this proves the nyquist sampling theorem.
to recover frequency f of the a sampled signal, the sampling frequecy Fs should be chosen such that Fs>=2f

COMMENT DOWN FOR ANY QUERY RELATED TO THIS ANSWER,
PLEASE PLEASE GIVE A THUMBS UP

Add a comment
Know the answer?
Add Answer to:
Choose a function of the form sin(2πnx/L) for some “large” integer frequency n and length L....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT