フィルターのクリア

recreating nyquist regions using FFT

12 ビュー (過去 30 日間)
fima v
fima v 2023 年 3 月 17 日
回答済み: Paul 2023 年 3 月 18 日
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));

回答 (1 件)

Paul
Paul 2023 年 3 月 18 日
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));

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by