plot the sine wave
Mostrar comentarios más antiguos
I need to plot x(n)=cos(3*pi*n/4) for values of n=0:255
Also compute and plot the 256-point DFT using (fft) and only display the first 128 DFT coefficients. I am not provided with any more information regarding sampling frequency or time version of signal. I am able to plot it however, the plot I get does not give me a smooth sinusoidal wave. I'm not sure if I'm doing it correct. Can someone aid me in the right direction please? here is my code:
N=256;
>> n=0:255;
>> x=cos(3*pi*n/4);
>> figure(1)
>> plot(n,x)
>> X=abs(fft(x,N))
>> plot(X)
>> axis([0,128,0,140])
Do I have to find out what the sampling frequency is and convert this digital signal into its time representation? Thanks again.
Christian
Respuestas (0)
Categorías
Más información sobre Discrete Fourier and Cosine Transforms en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!