Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

I am expecting to get 64 peaks (Sinc) within a range of 100MHz, but unfortunately, I can only see one peak in the said interval... Can anyone tell me what I am doing wrong in this code. If there is a better way of doing this task, let me know. Thanks

1 visualización (últimos 30 días)
N=1024; fs=100*10^6; T=1/fs;
vec=zeros(N,1); positions=[64 128 192 256 320 384 448 512 576 640 704 768 832 896 960 1024]; vec(positions)=1;
Cn=vec;
one_sided_span = 200*10^6; num_steps = 500; step_value = (2*one_sided_span)/num_steps; f = -one_sided_span:step_value:one_sided_span;
Sf = zeros(1,length(f)); for n=0:N-1 Sf_n = zeros(1,length(f)); for k=0:N-1
Sf_n = Sf_n + exp((-1i*(2*pi*k)/N)*((f/fs)-n));
end Sf = Cn(n+1).*Sf_n; Sf = Sf + Sf_n;
end
figure(2) plot(f,20*log10(abs(Sf_n))); title('Sf in log scale'); xlabel('Frequency(Hz)'); ylabel('Amplitude (dB)'); axis([-2*10^8 2*10^8 -10 40]);
figure(1) plot(Cn) title('The values of Cn'); xlabel('NFFT-Points'); ylabel('Amplitude'); axis([0 1050 0 1.5]);

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by