Below you will find a range of laboratory experiments for university students studying signals and systems. If you have any questions, please leave a comment or DM us on Instagram. We will get back to you with personal guidance asap.
Lab Report for Signals & Systems
There are 3 tasks in total. You can copy paste the code onto MATLAB. It should produce the image attached above each block of MATLAB code.
To learn the MATLAB commands used here, you might want to browse this guide: MATLAB commands
Task 1: Perform correlation of signals on MATLAB
MATLAB Code:
x1=[-4 1 3 7 -8 -2 -1];
x2=[4 2 -1 3 -2 -6 -5 4 5]; [y1,x1]=xcorr(x1,x2)
figure
stem(x1,y1)
xlabel(‘Time lag’) ylabel(‘Amplitude’)
title(‘correlation between x1 and x2’)
Task 2: Perform correlation and observe the effect of time shifting.
MATLAB code:
x1=[1 2 3 4];
[y1,n1]=xcorr(x1);
figure
subplot(311)
stem(n1,y1,’r’)
ylabel(‘y1’)
grid
x2=[0 0 1 2 3 4] [y2,n2]=xcorr(x2);
subplot(312)
stem(n2,y2,’b’)
ylabel(‘y2’)
grid
x3=[0 0 0 0 1 2 3 4];
[y3,n3]=xcorr(x3);
subplot(313)
stem(n3,y3,’g’)
ylabel(‘y’)
grid
Task 3: Detection of periodic signal
MATLAB Code:
n=0:99;
f=0.05;
a=4
x=a*sin(2*pi*f*n);
subplot(321)
stem(n,x,’r’)
title(‘sinewave’)
grid
[y1,n1]=xcorr(x);
subplot(322)
stem(n1,y1,’g’)
title(‘auto correlation’)
grid
w=wgn(1,100,2)
subplot(323)
stem(n,w,’b’)
title(‘White gaussain noise’)
grid
[y2,n2]=xcorr(w);
subplot(324) s
tem(n2,y2,’y’)
title(‘Auto correlation of wgn’)
y=x+w;
subplot(325)
stem(n,y,’y’)
title(‘sine+noise wave’)
grid
[y3,n3]=xcorr(y);
subplot(326)
stem(n3,y3,’y’)
What did you learn from these lab experiments?
With these lab experiments, you learned about correlation.
Correlation is a technique used to measure how similar two signals are.
It is important in digital signal processing (DSP) and helps with tasks like detecting signals, improving them, and even compressing data. By using the correlation function (r = xcorr(x, y)
), you calculated how similar two signals are at different time intervals.
You also explored autocorrelation, which is useful for finding repeating patterns in signals, even when there’s a lot of noise. Unlike non-repeating signals, where the autocorrelation fades with time, repeating signals maintain a consistent pattern.
These experiments showed you how correlation and autocorrelation are key tools in analyzing and processing signals, which is important for many applications in DSP.
As a biomedical engineer it’s important for you to learn because understanding and applying these techniques are crucial when analyzing biomedical signals, such as ECG or EEG dat
Leave a Reply