0% found this document useful (0 votes)
7 views4 pages

Lab 1

DIGITAL Signal Processing Lab 01

Uploaded by

jhordonhutt928
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Lab 1

DIGITAL Signal Processing Lab 01

Uploaded by

jhordonhutt928
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Lab 1

Objective
In this lab we will be able to:
 Generate basic signal like Sine waves, Ramp, Unit impulse, Ramp Signals

Introduction
This report describes the process of generating standard signals using MATLAB.
Standard signals include sine, cosine, square, and sawtooth waves, which are
commonly used in signal processing and communication systems.

Procedure
The MATLAB function 'sine' is used to generate a sine wave, 'cosine' for a cosine wave,
'square' for a square wave, and 'sawtooth' for a sawtooth wave. The amplitude,
frequency, and phase of the signal can be specified as input parameters to the function.
Additionally, the 'linspace' function is used to generate a vector of time points at which
the signal is sampled.

Code
% Define the amplitude, frequency, and phase of the sine wave
A = 1;
f = 2;
phi = 0;
% Define the time vector
t = 0:0.01:1;
% Generate the sine wave
x = A*sin(2*pi*f*t + phi);
% Plot the sine wave
stem(t,x);
xlabel('Time');
ylabel('Amplitude');
title('Sine Wave');
grid

Result
Lab Tasks
Generate and plot unit impulse.
% Define the time vector
t = -10:0.01:10;
% Generate the unit impulse sequence
x = t==0;
% Plot the unit impulse sequence
plot(t,x);
xlabel('Time');
ylabel('Amplitude');
title('Unit Impulse Sequence');
grid

Generate delayed unit step


n=0:0.5:10;
d=(n>=0);
stem(n,d);
title('step signal');
xlabel('n');
ylabel('magnitude');grid on;
axis([-10 10 0 2])
Generate ramp signal.
%generate ramp signal
n=0:0.5:3;
d=(n);
stem(n,d);
title('ramp signal');
xlabel('n');
ylabel('magnitude');
grid on;

Generate complex exponential signal.


c = -(1/12)+(pi/6)*i;
K = 2;
n = 0:40;
x = K*exp(c*n);
subplot(2,1,1);
stem(n,real(x));
title('Real part');
subplot(2,1,2);
stem(n,imag(x));
title('Imaginary part');
Conclusion
MATLAB provides a simple and convenient way to generate standard signals for use in
signal processing and communication systems. The 'sine', 'cosine', 'square', and
'sawtooth' functions allow for easy control of the amplitude, frequency, and phase of the
signal. This report demonstrates the use of these functions and provides example code
for generating a sine wave.

You might also like