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?

Answers (1)

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

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Asked:

on 9 Jul 2013

Community Treasure Hunt

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

Start Hunting!