For the fft function, what does it mean that a given sequence X is truncated?

In the documentation for the fft function, it says that for Y = fft(X,n), "if the length of X is greater than n,the sequence X is truncated." If X is any 100-element vector, and I input Y = fft(X,50), does this mean it truncates at the 50th element, or does it mean that it deletes every other element? How do I control where and how it truncates?

Réponses (1)

Matt J
Matt J le 9 Juil 2013
Modifié(e) : Matt J le 9 Juil 2013
It treats every element past the 50th as zero. Here's a small comparison to illustrate the idea:
>> fft(1:10,7)
ans =
28.0000 -3.5000 + 7.2678i -3.5000 + 2.7912i -3.5000 + 0.7989i -3.5000 - 0.7989i -3.5000 - 2.7912i -3.5000 - 7.2678i
>> fft([1:7, 0 0 0],7)
ans =
28.0000 -3.5000 + 7.2678i -3.5000 + 2.7912i -3.5000 + 0.7989i -3.5000 - 0.7989i -3.5000 - 2.7912i -3.5000 - 7.2678i

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Centre d'aide et File Exchange

Question posée :

le 9 Juil 2013

Community Treasure Hunt

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

Start Hunting!

Translated by