Skip to main content

Correlogram in MATLAB

 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

Output 



Copy the MATLAB Code from here

People are good at skipping over material they already know!

View Related Topics to







Admin & Author: Salim

profile

  Website: www.salimwireless.com
  Interests: Signal Processing, Telecommunication, 5G Technology, Present & Future Wireless Technologies, Digital Signal Processing, Computer Networks, Millimeter Wave Band Channel, Web Development
  Seeking an opportunity in the Teaching or Electronics & Telecommunication domains.
  Possess M.Tech in Electronic Communication Systems.


Contact Us

Name

Email *

Message *

Popular Posts

MATLAB Code for BER performance of QPSK with BPSK, 4-QAM, 16-QAM, 64-QAM, 256-QAM, etc

๐Ÿ“˜ Overview ๐Ÿงฎ MATLAB Codes ๐Ÿงฎ Theory ๐Ÿงฎ Are QPSK and 4-PSK same? ๐Ÿ“š Further Reading   QPSK offers double the data rate of BPSK while maintaining a similar bit error rate at low SNR when Gray coding is used. It shares spectral efficiency with 4-QAM and can outperform 4-QAM or 16-QAM in very noisy channels. QPSK is widely used in practical wireless systems, often alongside QAM in adaptive modulation schemes [Read more...]   MATLAB Code clear all; close all; % Set parameters for QAM snr_dB = -20:2:20; % SNR values in dB qam_orders = [4, 16, 64, 256]; % QAM modulation orders % Loop through each QAM order and calculate theoretical BER figure; for qam_order = qam_orders     % Calculate theoretical BER using berawgn for QAM     ber_qam = berawgn(snr_dB, 'qam', qam_order);     % Plot the results for QAM     semilogy(snr_dB, ber_qam, 'o-', 'DisplayName', sprintf('%d-QAM', qam_order));  ...

Differences between Baseband and Passband Modulation Techniques

๐Ÿ“˜ Overview ๐Ÿงฎ Difference betwen baseband and passband ๐Ÿงฎ Baseband modulation techniques ๐Ÿงฎ Passband modulation techniques ๐Ÿ“š Further Reading   1. Frequency Translation Baseband Modulation: The signal occupies the lower end of the frequency spectrum, close to DC (0 Hz). Noise at these frequencies (such as 1/f noise or flicker noise) can significantly impact the signal.  Passband Modulation: The signal is shifted to a higher frequency range by modulating it with a carrier frequency. This translation can help to avoid low-frequency noise and interference, which are often more prevalent and stronger in the baseband. 2. Bandpass Filtering Baseband Modulation: The filtering of baseband signals is often limited by the need to preserve the low-frequency components of the signal. This makes it difficult to filter out low-frequency noise effectively. Passband Modulation: The modulated signal can be passed through a bandpass filter centered around t...

MATLAB code for MSK

๐Ÿ“˜ Overview ๐Ÿงฎ MATLAB Codes ๐Ÿงฎ Theory ๐Ÿงฎ Simulator for MSK ๐Ÿ“š Further Reading  Copy the MATLAB Code from here % The code is developed by SalimWireless.com clc; clear; close all; % Define a bit sequence bitSeq = [0, 1, 0, 0, 1, 1, 1, 0, 0, 1]; % Perform MSK modulation [modSignal, timeVec] = modulateMSK(bitSeq, 10, 10, 10000); % Plot the modulated signal subplot(2,1,1); samples = 1:numel(bitSeq); stem(samples, bitSeq); title('Original message signal'); xlabel('Time (s)'); ylabel('Amplitude'); % Plot the modulated signal subplot(2,1,2); samples = 1:10000; plot(samples / 10000, modSignal(1:10000)); title('MSK modulated signal'); xlabel('Time (s)'); ylabel('Amplitude'); % Perform MSK demodulation demodBits = demodMSK(modSignal, 10, 10, 10000); % Function to perform MSK modulation function [signal, timeVec] = modulateMSK(bits, carrierFreq, baudRate, sampleFreq) % Converts a binary bit sequence in...

Constellation Diagrams of ASK, PSK, and FSK

๐Ÿ“˜ Overview ๐Ÿงฎ Simulator for constellation diagrams of ASK, FSK, and PSK ๐Ÿงฎ Theory ๐Ÿงฎ MATLAB Codes ๐Ÿ“š Further Reading BASK (Binary ASK) Modulation: Transmits one of two signals: 0 or -√Eb, where Eb​ is the energy per bit. These signals represent binary 0 and 1.    BFSK (Binary FSK) Modulation: Transmits one of two signals: +√Eb​ ( On the y-axis, the phase shift of 90 degrees with respect to the x-axis, which is also termed phase offset ) or √Eb (on x-axis), where Eb​ is the energy per bit. These signals represent binary 0 and 1.  BPSK (Binary PSK) Modulation: Transmits one of two signals: +√Eb​ or -√Eb (they differ by 180 degree phase shift), where Eb​ is the energy per bit. These signals represent binary 0 and 1.    Simulator for BASK, BPSK, and BFSK Constellation Diagrams SNR (dB): 15 Add A...

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...

๐Ÿ“˜ Overview of BER and SNR ๐Ÿงฎ Simulator for m-ary QAM and m-ary PSK ๐Ÿงฎ MATLAB Codes ๐Ÿ“š Further Reading Modulation Constellation Diagrams BER vs. SNR BER vs SNR for M-QAM, M-PSK, QPSk, BPSK, ... What is Bit Error Rate (BER)? The abbreviation BER stands for bit error rate, which indicates how many corrupted bits are received (after the demodulation process) compared to the total number of bits sent in a communication process. It is defined as,  In mathematics, BER = (number of bits received in error / total number of transmitted bits)  On the other hand, SNR refers to the signal-to-noise power ratio. For ease of calculation, we commonly convert it to dB or decibels.   What is Signal the signal-to-noise ratio (SNR)? SNR = signal power/noise power (SNR is a ratio of signal power to noise power) SNR (in dB) = 10*log(signal power / noise power) [base 10] For instance,...

Comparisons among ASK, PSK, and FSK | And the definitions of each

๐Ÿ“˜ Overview ๐Ÿงฎ Simulator ๐Ÿงฎ Noise Sensitivity, Bandwidth, Complexity, etc. ๐Ÿงฎ MATLAB Codes ๐Ÿงฎ Some Questions and Answers ๐Ÿ“š Further Reading Modulation ASK, FSK & PSK Constellation MATLAB Simulink MATLAB Code Comparisons among ASK, PSK, and FSK    Comparisons among ASK, PSK, and FSK   Simulator for Calculating Bandwidth of ASK, FSK, and PSK The baud rate represents the number of symbols transmitted per second. Both baud rate and bit rate are same for binary ASK, FSK, and PSK. Select Modulation Type: ASK FSK PSK Baud Rate or Bit Rate (bps): Frequency Deviation (Hz) for FSK: Calculate Bandwidth Comparison among ASK,  FSK, and PSK Performance Comparison: 1. Noise Sensitivity:    - ASK is the most sensitive to noise due to its r...

UGC NET Electronic Science Previous Year Question Papers

Home / Engineering & Other Exams / UGC NET 2022: Previous Year Question Papers ...   NET | GATE | ESE | UGC-NET (Electronics Science, Subject code: 88 ) UGC Net Electronic Science Questions Paper With Answer Key Download Pdf [December 2024] UGC Net Electronic Science Questions Paper With Answer Key Download Pdf [June 2024] UGC Net Electronic Science Questions Paper With Answer Key Download Pdf [December 2023] UGC Net Electronic Science Questions Paper With Answer Key Download Pdf [June 2023] UGC Net Electronic Science Questions Paper With Answer Key Download Pdf [December 2022]  UGC Net Electronic Science Questions Paper With Answer Key Download Pdf [June 2022]   UGC Net Electronic Science Questions Paper With Answer Key Download Pdf [December 2021] UGC Net Electronic Science Questions With Answer Key Download Pdf [June 2020] UGC Net Electronic Science Questions With Answer Key Download Pdf [December 2019] UGC Net Electronic Science Questions With Answer...