In FFT (Fast Fourier Transform), the step size refers to the spacing between consecutive points in the output data after performing the transform. It's often determined by the sampling rate of the signal. The step size is crucial for accurate frequency representation, and smaller step sizes provide finer frequency resolution in the resulting frequency domain representation.
Step Size of a Signal in the Time Domain
Suppose you have a signal sampled at 1000 Hz (sampling rate) for a duration of 1 second. The step size, or the time difference between consecutive samples, is then given by the inverse of the sampling rate:
If you perform an FFT on this signal, the resulting frequency resolution in the frequency domain will be determined in part by this step size. Smaller step sizes provide a finer frequency resolution.
Step Size of a Signal in the Frequency / FFT Domain
Step Size in the Frequency Domain
The step size in the frequency domain refers to the spacing between adjacent frequency bins in the FFT output. It is determined by the signal's sampling rate and the size of the FFT:
Where:
- Δf: Frequency step size (frequency resolution).
- fs: Sampling rate (Hz).
- N: FFT size (number of bins).
Total Bandwidth
The total bandwidth covered by the FFT is determined by the sampling rate and the Nyquist theorem:
Frequencies above the Nyquist frequency (fs/2) cannot be represented due to aliasing.
Frequency Step Size after FFT
Combining the above, the frequency step size (bin width) in the FFT output is:
Key Observations:
- Smaller Δf results in higher frequency resolution.
- To achieve smaller Δf, increase the FFT size (N) or the signal's duration (T).
- Total bandwidth is inversely proportional to the number of bins (N).
MATLAB Code
% The code is developed by SalimWireless.Comclc;
clear all;
close all;
% Parameters
fs = 1000; % Sampling frequency (Hz)
T = 1; % Duration (seconds)
N1 = 256; % FFT size for coarse resolution
N2 = 1024; % FFT size for fine resolution
t = 0:1/fs:T-1/fs; % Time vector
% Signal with multiple frequency components
f1 = 50; % Frequency 1 (Hz)
f2 = 60; % Frequency 2 (Hz)
f3 = 200; % Frequency 3 (Hz)
signal = sin(2*pi*f1*t) + sin(2*pi*f2*t) + sin(2*pi*f3*t);
% FFT with coarse resolution (N1)
fft_coarse = fft(signal, N1);
frequencies_coarse = (0:N1-1)*(fs/N1); % Frequency vector
magnitude_coarse = abs(fft_coarse);
% FFT with fine resolution (N2)
fft_fine = fft(signal, N2);
frequencies_fine = (0:N2-1)*(fs/N2); % Frequency vector
magnitude_fine = abs(fft_fine);
% Plotting
figure;
% Coarse Resolution Plot
subplot(2, 1, 1);
plot(frequencies_coarse(1:N1/2), magnitude_coarse(1:N1/2));
title('FFT with Coarse Resolution (N = 256) where step size is 3.906');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
grid on;
% Fine Resolution Plot
subplot(2, 1, 2);
plot(frequencies_fine(1:N2/2), magnitude_fine(1:N2/2));
title('FFT with Fine Resolution (N = 1024) where step size is 0.977');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
grid on;