Difference between revisions of "Component: Fast Fourier Transform (FFT) (DSP)"
Line 25: | Line 25: | ||
− | Example takes 256 analogue readings using an ADC input and then passes the collection of 256 samples to the FFT function which produces 128 individual frequency banks which are then plotted from left to right on the graphical LCD. | + | Example takes 256 analogue readings using an ADC input and then passes the collection of 256 samples to the FFT function which produces 128 individual frequency banks which are then plotted from left (lowest frequency) to right (highest frequency) on the graphical LCD. |
[[File:FFT.jpg]] | [[File:FFT.jpg]] | ||
+ | |||
+ | |||
+ | Frequency banks can be worked out by using the sample frequency and buffer size. The number of frequency banks is equal to the number of samples divided by 2 minus 1. | ||
+ | |||
+ | FrequencyBanks = (SampleCount / 2) - 1 | ||
+ | |||
+ | |||
+ | The frequency ranges present inside a bank can be worked out as follows. | ||
+ | |||
+ | FreqMin = ((SampleRate / 2) / (SampleCount / 2)) * Bank | ||
+ | |||
+ | FreqMax = ((SampleRate / 2) / (SampleCount / 2)) * (Bank + 1) | ||
==Downloadable macro reference== | ==Downloadable macro reference== |
Revision as of 12:32, 24 February 2014
Author | Matrix Ltd |
Version | 1.1 |
Category | DSP |
Contents
Fast Fourier Transform (FFT) component
Provides a way of converting a buffer full of time domain data into frequency domain data. The output of the FFT is a set of frequency bins which correspond to the frequencies present in the signal. The number of frequency bins is equal to half the input buffer size with each bin being responsible for a portion of the frequency up to 1/2 the nyquist.
Examples
FFT Example File
Example takes 256 analogue readings using an ADC input and then passes the collection of 256 samples to the FFT function which produces 128 individual frequency banks which are then plotted from left (lowest frequency) to right (highest frequency) on the graphical LCD.
Frequency banks can be worked out by using the sample frequency and buffer size. The number of frequency banks is equal to the number of samples divided by 2 minus 1.
FrequencyBanks = (SampleCount / 2) - 1
The frequency ranges present inside a bank can be worked out as follows.
FreqMin = ((SampleRate / 2) / (SampleCount / 2)) * Bank
FreqMax = ((SampleRate / 2) / (SampleCount / 2)) * (Bank + 1)
Downloadable macro reference
ReadFrequencyBank
No additional information
Parameters
- UINT BankIdx
Return value
FFT
No additional information
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Buffer Manager
This property is of type Fixed list of ints and can be referenced with the variable name buffer_manager.
No additional information
Input
This property is of type Fixed list of ints and can be referenced with the variable name input_a.
No additional information
Output Real
This property is of type Fixed list of ints and can be referenced with the variable name output_c.
No additional information
Output Imaginary
This property is of type Fixed list of ints and can be referenced with the variable name output_i.
No additional information
Accuracy
This property is of type Fixed list of ints and can be referenced with the variable name FFT_accuracy.
No additional information
Bit Depth
This property is of type Fixed list of ints and can be referenced with the variable name bit_depth.
No additional information
Sample Rate
This property is of type Floating point and can be referenced with the variable name sample_rate.
No additional information
Nyquist Frequency
This property is of type Floating point and can be referenced with the variable name nyquist.
No additional information
Frequency Bin Count
This property is of type Signed integer and can be referenced with the variable name bin_count.
No additional information
Frequency Bin Size (Hz)
This property is of type Floating point and can be referenced with the variable name bin_size.
No additional information