Azzera filtri
Azzera filtri

remove zeros from sinc function

1 visualizzazione (ultimi 30 giorni)
Hi there,
I am trying to observe the behaviour of the fourier trasform of the sinc function if some of its zeros will be removed. Normally, the sinc function will lead us to rectanglular function in fourier domain, but when I am trying to remove the zeros at 'pi' it is not showing anything due to NaN or infinite. May I request you to pls tell me how to deal with such problem?
Fs=42;Ts=1/Fs;
t=-1:Ts:40*Ts-Ts;
f=5;
y=sinc(t*f)/(1-5*t/(0.9)*pi);
figure;
plot(t,y);
xlabel('x');
ylabel(' magnitude');
fy=fft(y);%figure;
% plot(fy)
fy = fftshift(fy);figure;
plot([abs(fy)])%;angle(fy);real(fy);imag(fy)]','*')
  2 Commenti
Jan
Jan il 17 Mag 2019
Modificato: Jan il 17 Mag 2019
It is easier to read, if you include the code directly. Therefore I've copied it from the attachment.
"it is not showing anything due to NaN or infinite" - what is "it" here?
Gaurav Sharma
Gaurav Sharma il 18 Mag 2019
"the plot"- is not showing any thing... no plot.... just blank screen

Accedi per commentare.

Risposta accettata

Sulaymon Eshkabilov
Sulaymon Eshkabilov il 18 Mag 2019
clearvars; close all
Fs=42;Ts=1/Fs;
t=-1:Ts:1;
f=5;
y=sinc(t*f)./(1-5*t/(0.9)*pi);
figure;
plot(t,y), xlabel('t'), ylabel(' y(t)'); title('Time domain analysis ')
L = length(t); Nblock = 256;
Y = fft(y, Nblock)/L;
f = Fs/2*linspace(0,2, Nblock/2+1);
figure;
plot(f, 2*abs(Y(1:Nblock/2+1))), title('Discrete FFT')
fY = fftshift(Y);figure;
plot(f, 2*abs(fY(1:Nblock/2+1))), title('Shift zero frequency')
figure, plot([angle(fY);real(fY);imag(fY)]','*')
title('Phase angle, Real & Imag components of Shift zero frequency')

Più risposte (0)

Categorie

Scopri di più su Dialog Boxes in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by