Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

LAB MANUAL

LAB EXPERIMENT - 04: SIMPLE OPERATIONS ON SEQUENCES AND SIGNAL SMOOTHING.

SIMPLE OPERATIONS ON SEQUENCES AND SIGNAL


SMOOTHING.
PERFORMANCE OBJECTIVES:
Upon completion of this laboratory exercise, the student technicians/engineers will be able to:
1. Use OCTAVE commands for operations on sequences.
2. Use signal smoothing in OCTAVE.
EQUIPMENT:
1 OCTAVE equipped PC

DISCUSSION:
SIGNAL SMOOTHING
As indicated earlier, the purpose of signal processing is to generate a signal with more desirable properties from
one or more given discrete-time signals. The processing algorithm consists of performing a combination of basic
operations such as addition, scalar multiplication; time-reversal, delaying, and product operation. We consider here
very simple example to illustrate the application of such operations.
A common example of a signal processing application is the removal of the noise component from a signal
corrupted by additive noise.
Let s[n] is the signal corrupted by a random noise d[n] resulting in the noisy signal: x[n]=s[n]+d[n]. The objective
is to operate on x[n] to generate a signal y[n] which is a reasonable approximation to s[n].
To this end, a simple approach is to generate an output sample by averaging a number of input samples around the
sample at instant n.
For example, a three-point moving average algorithm is given by:
y[n]=1/3(x[n-1]+x[n]+x[n+1])

Script P1_4 implements the above algorithm:


OCTAVE SCRIPT.
% Program P1_4
% Signal Smoothing by Averaging
clf;
R = 51;
d = 0.8*(rand(R,1) - 0.5);
% Generate random noise
m = 0:R-1;
s = 2*m.*(0.9.^m);
% Generate uncorrupted signal
x = s + d';
% Generate noise corrupted signal
subplot(2,1,1);
plot(m,d','r-',m,s,'g--',m,x,'b-.');
xlabel('Time index n');
ylabel('Amplitude');
legend('d[n] ','s[n] ','x[n] ');

x1 = [0 0 x];
x2 = [0 x 0];
x3 = [x 0 0];

y = (x1 + x2 + x3)/3;
subplot(2,1,2);
plot(m,y(2:R+1),'r-',m,s,'g--');
legend('y[n] ','s[n] ');
xlabel('Time index n');
ylabel('Amplitude');

CSE 351 – SIGNALS & SYSTEMS ANALYSIS.


1
LAB MANUAL
LAB EXPERIMENT - 04: SIMPLE OPERATIONS ON SEQUENCES AND SIGNAL SMOOTHING.

QUESTIONS
Q4.1 Run Program P1_4 and generate all pertinent signals.
Q4.2 What is the form of the uncorrupted signal s[n]? What is the form of the additive noise d[n]?
Can you use the statement (x=s+d) instead of (x=s+d') to generate the noise-corrupted signal?
Q4.3
If not, why not?
Q4.4 What are the relations between the signals x1, x2, and x3, and the signal x?
Q4.5 What is the purpose of the legend command?

YANBU UNIVERSITY COLLEGE


2

You might also like