Borrar filtros
Borrar filtros

remove zeros from sinc function

1 visualización (últimos 30 días)
Gaurav Sharma
Gaurav Sharma el 17 de Mayo de 2019
Respondida: Sulaymon Eshkabilov el 18 de Mayo de 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 comentarios
Jan
Jan el 17 de Mayo de 2019
Editada: Jan el 17 de Mayo de 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 el 18 de Mayo de 2019
"the plot"- is not showing any thing... no plot.... just blank screen

Iniciar sesión para comentar.

Respuesta aceptada

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 18 de Mayo de 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')

Más respuestas (0)

Categorías

Más información sobre Dialog Boxes en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by