Borrar filtros
Borrar filtros

Plotting a time domain Signal

2 visualizaciones (últimos 30 días)
Abdelrhman Abdelfatah
Abdelrhman Abdelfatah el 24 de Mayo de 2022
Respondida: Chunru el 24 de Mayo de 2022
I want to plot the continuous time domain signal for the following spectrum:
and here is what i have done so far, are there any possible improvments to this?
N=256;
xn=zeros(1,N);
for n=0:1:N-1
xn(n+1)= 2*(sign(n - -1) - sign(n - 1));
end
%Taking inverse DFT
x_i=ifft(xn);
wk = 0:1:N-1;
plot(wk,x_i);

Respuestas (1)

Chunru
Chunru el 24 de Mayo de 2022
N=256;
f=(0:N-1)/N;
xf = 2*sinc(2*f); % 2*sin(w)/w => 2*sinc(2*f)
x_i=ifft(xf);
plot(f, real(x_i), 'r', f, imag(x_i), 'b');

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by