recreating nyquist regions using FFT
11 views (last 30 days)
Show older comments
Hello,Using code bellowI have sampled a signal and made FFT to see the spectral picture of the time domain signal. the plot bellow shows only 1st and 2nd nyquist zone. I want to expend the spectral image and see the 3rd and 4th nyquist zones.
i have tried to double number of samples but it only expand the previos image two times. where did i go wrong recreating addional nyquist zones? Thanks.
clc
clear all
Fs=200e3;
Ts=1/Fs;
dt=0:Ts:5e-3-Ts;
f1=1e3;
f2=20e3;
f3=30e3;
y=5*sin(2*pi*f1*dt)+5*sin(2*pi*f2*dt)+10*sin(2*pi*f3*dt);
%plot(dt,y)
nfft=length(y);
nfft2=1000;
fy=fft(y,nfft2);
f_half=2*fy(1:(nfft2));
xfft=Fs.*(0:(nfft2)-1)/nfft2;
plot(xfft,abs(f_half)/(nfft));
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1328490/image.jpeg)
0 Comments
Answers (1)
Paul
on 18 Mar 2023
Are the "third" and "fourth" Nyquist zone the frequencies from Fs to 3*Fs/2 and from 3*Fs/2 to 2*Fs respectively? If so, third is just a copy of the first and the fourth is just a copy of the second, because the Discrete Time Fourier Transform is periodic with period Fs. So, if a plot is really desired it's just
clc
clear all
Fs=200e3;
Ts=1/Fs;
dt=0:Ts:5e-3-Ts;
f1=1e3;
f2=20e3;
f3=30e3;
y=5*sin(2*pi*f1*dt)+5*sin(2*pi*f2*dt)+10*sin(2*pi*f3*dt);
%plot(dt,y)
nfft=length(y);
nfft2=1000;
fy=fft(y,nfft2);
Not sure why fy is being multiplied by 2? But we'll keep it ...
f_half=2*fy(1:(nfft2));
f_half = repmat(f_half,1,2);
xfft=Fs.*(0:(numel(f_half))-1)/numel(f_half)*2;
plot(xfft,abs(f_half)/(nfft));
0 Comments
See Also
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!