Steps to compute correlogram of an input signal
1. Compute the autocorrelation function of narrowband_signal
2. Computes the Fast Fourier Transform (FFT) of the autocorrelation function (acf
), resulting in corr_spectrum
.
3. freq = (0:N-1)*(fs/N); Constructs a frequency vector (freq
) corresponding to the FFT results, spanning from 0 Hz to just under the Nyquist frequency (fs/2
). Where, N = Number of Samples in the Input Signal
4. Plots the magnitude of the FFT (abs(corr_spectrum)
) against the frequency vector (freq
), showing the correlogram of the narrowband signal.
MATLAB Code
clc;clear;
close all;
%Parameters
fs = 1000; % Sampling frequency
t = 0:1/fs:1-1/fs; % Time vector
N = length(t); % Number of samples
%Generate narrowband signal
f0 = 50; % Center frequency of narrowband process
narrowband_signal = sin(2*pi*f0*t) + 0.5*randn(size(t)); % Narrowband signal with noise
%Compute autocorrelation function (ACF) of narrowband signal
acf = autocorrelation(narrowband_signal);
%Compute FFT of ACF (Correlogram)
corr_spectrum = fft(acf);
%Frequency vector
freq = (0:N-1)*(fs/N);
%Plot correlogram results for narrowband signal
figure;
plot(freq, abs(corr_spectrum(1:N)));
title('Correlogram - Narrowband Signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
%Function to compute autocorrelation
function acf = autocorrelation(signal)
N = length(signal);
acf = zeros(1, N);
for k = 1:N
acf(k) = sum(signal(1:N-k+1) .* signal(k:N));
end
end