Matlab

To plot autocorrelation and frequency response of a system in differential equation form for the given sequences

Theory for autocorrelation:

Auto Correlation Function Autocorrelation function is a measure of similarity between a signal & its time-delayed version. It is represented with R(k). While the autocorrelation function of x(n) is determined by

R11 (k) =R(k)=

Steps to perform auto correlation:

  • And the given input sequence is x[n].
  • Let the given impulse response of sequence h (n).
  • In order to auto correlation by using the matlab command xcorr.
  • Let’s plot the sequence x[n], h[n], z[n].
  • Next step is to display the result.

Program:

clc;

close all;

clear all;

% Let’s the two input sequences

x=input(‘enter input sequence’)

subplot(1,2,1);

stem(x);

xlabel(‘n’);

ylabel(‘x(n)’);

title(‘input sequence’);

% And the auto correlation of the given input sequence

z=xcorr(x, x);

disp(‘The values of z are = ‘);

disp(z);

subplot(1,2,2);

stem(z);

xlabel(‘n’);

ylabel(‘z(n)’);

title(‘auto correlation of input sequence’);

OUTPUT:

Enter input sequence [2 4 5 6]

x = 2     4     5     6

And the values of z are =

   12.0000   34.0000   58.0000   81.0000   58.0000   34.0000   12.0000

The frequency response of the signal in differential equation form:

Systems respond differently to inputs of different frequencies. Where some of the systems may amplify components with certain frequencies, and attenuate components of other frequencies. And the way system output is related to the system input with different frequencies is called the frequency response of the system. We can convert it to polar notation in the complex plane. This will provides us the magnitude and an angle. We call the angle the phase.

Amplitude Response: For each frequency, the magnitude represents the system’s tendency to amplify or attenuate the input signal.

Phase Response: The phase represents the system’s tendency to modify the phase of the input sinusoids.

Steps for obtaining frequency response of the signal:

  • And the given numerator coefficients of the given transfer function or difference equation.
  • And the given denominator coefficients of the given transfer function or difference equation
  • Let’s pass these coefficients to matlab command freqz to find frequency response.
  • In order to find magnitude and phase response by using matlab commands abs and angle.
  • Let’s plot the magnitude and phase response.

Program:

clc;

clear all;

b=input(‘Enter the numerator coefficients:’);

a=input(‘Enter the denominator coefficients:’);

[h,w]=freqz(b,a);

subplot(2,1,1);

plot(w/pi,abs(h));

grid;

xlabel(‘Normalised Frequency’);

ylabel(‘Magnitude in dB’);

title(‘Magnitude Response’);

subplot(2,1,2);

plot(w/pi,angle(h));

grid;

xlabel(‘Normalized Frequency’);

ylabel(‘phase in radians’);

title(‘Phase Response’);

Rajeshwari Chiluveru

Rajeshwari (M.Tech) is the Technical Education Director at WebVidyalayam. She focuses on translating high-level systems engineering into accessible technology courses.

Share
Published by
Rajeshwari Chiluveru

Recent Posts

Samsung TV Red Light Blinking? 4 Fixes (2026 Power Logic Hub)

User Problem Scenario: The Red Light "Panic" You press the power button on your Samsung…

5 days ago

Samsung TV Not Connecting to WiFi: 2026 Easy Fix Guide

Introduction: I Know the Feeling "We’ve all been there. You sit down to watch your…

6 days ago

Samsung TV Restarting During Diagnosis? Fix the Reboot Loop Fast

User Problem Scenario: The "Diagnosis Loop" Paradox Imagine you notice your apps are slow. You…

7 days ago

Samsung TV Optimize Now Not Working? (2026 Fix: Greyed Out, Stuck or Not Responding)

🎓 Technical Module: Memory Maintenance Logic Module: WV-OS-307 Verified 2026 👨‍🏫 Instructor: Vangari Divya (M.Tech)…

1 week ago

Samsung Smart Hub Test Failed? (2026 Fix: DNS, ISP Block & Authentication Error)

 Introduction: The Setup Paradox "There is a specific moment of frustration for every Samsung Smart…

2 weeks ago

Samsung TV Picture Test Not Working? 4 Technical Recovery Fixes

Introduction: Lab Diary & Experience "When your Samsung TV screen begins to flicker or show…

2 weeks ago