Filter löschen
Filter löschen

remove zeros from sinc function

1 Ansicht (letzte 30 Tage)
Gaurav Sharma
Gaurav Sharma am 17 Mai 2019
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 Kommentare
Jan
Jan am 17 Mai 2019
Bearbeitet: Jan am 17 Mai 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 am 18 Mai 2019
"the plot"- is not showing any thing... no plot.... just blank screen

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 18 Mai 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')

Weitere Antworten (0)

Kategorien

Mehr zu Dialog Boxes finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by