The Fast Fourier Transform (FFT) calculated using blocking. There are two forms. |
||
Syntax |
y = BlockFft(vec, block_size, overlap, length) y = BlockFft(vec, window, overlap, length) |
|
Arguments |
Name |
Description |
vec |
A vector of input signal. |
|
block_size |
The number of elements to be used for each FFT. Must be a positive integer and not greater than the length of vec. |
|
window |
A vector of window weights to apply to each block. It's length is used as the block_size. |
|
overlap |
The number of elements shared between consecutive blocks. Must be a non-negative integer and less than block_size. |
|
length (optional) |
The length of the output vectors if specified as a positive integer. If omitted or zero, the length will be the block size or window length. If the length is specified as ‘pad’, the length will be rounded up, if necessary, to obtain a power of 2. See Comments. |
|
Output |
Name |
Description |
y |
A vector of the complex valued FFT. Its length is equal to that of block_size or window unless argument length is specified. |
|
Example 1 |
Find the FFT of a signal stored in vector data, using a block size of 256 and an overlap of 128: |
|
Syntax |
||
output = BlockFft(data, 256, 128) |
||
Result |
||
output is a vector of the complex valued FFT. |
||
Example 2 |
Repeat the above example with a Hanning window instead: |
|
Syntax |
||
output = BlockFft(data, HannWin(256), 128) |
||
Results |
||
output is a vector of the complex valued FFT. |
||
Comments |
The BlockFft function uses blocking to calculate the Fast Fourier Transform (FFT). The FFT is complex-valued and used to map time-domain data into the frequency domain. vec is assumed to be evenly sampled. The BlockFft function is different from a normal FFT in that it introduces blocking. The input vector is subdivided into blocks. An FFT is then performed on each individual block. The results of these FFTs are then averaged to give the final result. When length is set to ‘pad’, the block size is padded with zeros (if needed) to round it up to power of 2 before performing a FFT on the block. The output can be used to extract magnitude and phase. |
|
See Also: |