how to use the fft and fftshift commands ?

4 visualizaciones (últimos 30 días)
ayman daraghmah
ayman daraghmah el 12 de Oct. de 2015
Respondida: Image Analyst el 12 de Oct. de 2015
generate a 10 kHz sinusoid sampled at 100 kHz. Plot four cycles of the signal. Also plot the spectrum of this signal in the interval (-π, π). Use the fft and fftshift commands for this purpose. The horizontal axis must be scaled appropriately to represent the interval (-π, π).

Respuestas (1)

Image Analyst
Image Analyst el 12 de Oct. de 2015
Use the formula y = amplitude * sin(2*pi*frequency*t). You might also like to use t = linspace(-pi, pi, n). Figure out what n needs to be to get 4 cycles of the 10 kHz sine wave.
Of course if the t axis goes from -pi to +pi seconds, then 4 cycles of a 10 kHz sine wave will take up a very very small portion of your signal, just 4 ten thousandths of a second - barely visible in the much wider 2*pi plot. So your signal is essentially masked by a rect function. Perhaps it does this so you'll notice a sinc function modulation on the Fourier spectrum rather than just two narrow delta function spikes.

Categorías

Más información sobre Spectral Measurements 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