0% found this document useful (0 votes)
17 views7 pages

Lab 1

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

Lab 1

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

Name: Mohit Agarwalla

PRN: 20210802152

EXPERIMENT-1

Aim:
Generation of Discrete Time Sequences of:
(a) Unit impulse signal
(b) Unit step signal
(c) Sinusoidal signal
(d) Cosine signal
(e) Sawtooth wave

Requirements:
MATLAB Online version- R2023a

(a) Unit impulse signal

Description:

The unit impulse signal, often denoted as δ(t) in continuous-time or δ[n] in discrete-time, is a
fundamental concept in signal processing and mathematics. It is also known as the Dirac delta
function. It's defined as 1 when n is 0 and 0 otherwise, resembling a spike at n = 0 on a discrete
signal plot. To execute a process involving the unit impulse signal, you follow these steps: First,
define the signal processing operation you want to perform. Second, generate the impulse by
setting δ[n] to 1 at n = 0 and 0 elsewhere. Third, apply this impulse to the system or operation of
interest, such as convolution or filtering. Fourth, analyze the result to gain insights into how the
system responds to an instantaneous change at n = 0, often referred to as the system's impulse
response. This process is crucial for understanding and manipulating the behavior of discrete-
time systems and signals in signal processing.

Program:
% Generation of unit impulse signal
close all;
N = input ('Enter the length of the sequence:');
t = -N :1: N;
Y = [zeros (1, N),1, zeros (1, N)];
Subplot (3,2,1);
Stem (t, Y);
xlabel('Time');
ylabel('Amplitude');
title ('Unit Impulse Signal');

Result:
Enter the length of the sequence: 4

Observation:
The unit impulse signal will have a single impulse (spike) at time t = 0, representing a discrete-
time impulse or Dirac delta function. The N value you enter will determine the number of zeros
on both sides of the impulse.

(b) Unit step signal

Description:
A unit step signal, denoted as u[n], is a fundamental signal in signal processing, defined as 1 for
n greater than or equal to zero and 0 for n less than zero. It resembles a step that starts at n = 0
and continues indefinitely in the positive direction on a discrete signal plot. To execute a process
involving the unit step signal, you can follow these steps: First, clearly define the signal
processing operation of interest. Second, generate the unit step signal u[n] based on its definition.
Third, apply this signal to the system or operation, such as convolution or filtering. Finally,
analyze the result to gain insights into how the system responds to a continuous input starting at
n = 0. This is particularly useful for understanding how systems react to gradual changes or
continuous signals over time, making the unit step signal a vital tool in signal processing for such
scenarios.
Program:
% Generation of unit step signal
close all;
N = input ('Enter the length of the sequence:');
t = 0 :1: N-1;
Y1 = ones (1, N);
Subplot (3,2,2);
stem (t, Y1);
xlabel('Time');
ylabel('Amplitude');
title ('Unit Step Signal');

Result:
Enter the length of the sequence: 5

Observation:
The unit step signal will have a value of 1 for all time instants greater than or equal to zero,
effectively representing a signal that "turns on" or becomes active at t = 0 and remains active
thereafter for the specified length (N) of the sequence.

(c) Sinusoidal signal

Description:
A sinusoidal signal is a fundamental waveform in signal processing, typically represented as x[n]
= A * sin (ωn + φ), where A is the amplitude, ω is the angular frequency, n is the discrete time
index, and φ is the phase angle. This signal exhibits a periodic oscillation resembling a sine
wave. A sinusoidal signal is a type of signal that varies over time following a sinusoidal (sine or
cosine) waveform pattern. Sinusoidal signals are characterized by their periodic oscillations
and are
commonly encountered in various fields of science and engineering. They are fundamental in
signal processing, mathematics, physics, and many other disciplines

Program:
% Generation of Sinusoidal signal
close all;
N = input ('Enter the length of the sequence:');
wave = sin(.2*pi*t);
subplot (3,2,3);
stem (t, wave);
xlabel('Time');
ylabel('Amplitude');
title ('Sinusoidal Signal');

Result:
Enter the length of the sequence: 5

Observation:
Sinusoidal signals exhibit periodic oscillations and are characterized by their amplitude,
frequency, and phase. They are fundamental in signal processing, as they model many natural
phenomena, and analyzing them helps understand frequency content and harmonic components
within signals.

(d) Cosine signal

Description:
A cosine signal is a fundamental waveform in signal processing, typically represented as x[n] = A
* cos (ωn + φ), where A is the amplitude, ω is the angular frequency, n is the discrete time index,
and φ is the phase angle. This signal exhibits a periodic oscillation resembling a cosine wave. To
utilize a cosine signal in a signal processing context, first, specify the required parameters such
as amplitude, frequency, and phase angle. Second, create the cosine signal using the specified
parameters. Third, apply this signal to the relevant signal processing operation or system. Lastly,
analyze the output to understand how the system responds to this periodic input.

Program:
% Generation of Cosine signal
close all;
N = input ('Enter the length of the sequence:');
wave = cos(.2*pi*t);
subplot (3,2,4);
stem (t, wave);
xlabel('Time');
ylabel('Amplitude');
title ('Cosine Signal');

Result:
Enter the length of the sequence: 5

Observation:
Similar to sinusoidal signals, cosine signals are periodic and vital in signal processing for tasks
involving harmonic analysis and modulation. They provide an alternative phase-shifted
representation of periodic phenomena compared to sine waves.

(e) Sawtooth wave

Description:
A sawtooth wave is a common waveform in signal processing, characterized by a linear rise in
amplitude followed by a sudden drop, resembling the teeth of a saw blade. It is typically represented
as x[n] = (2A / T) * (n % T) - A, where A is the amplitude, T is the period, n is the discrete time
index, and "%" denotes the modulo operator. To utilize a sawtooth wave in signal processing, begin
by specifying its parameters, including amplitude and period. Next, generate the sawtooth waveform
according to these parameters. Then, apply this waveform to the relevant signal processing operation
or system. Lastly, analyze the output to understand how the system responds to this unique and
periodic input. Sawtooth waves are essential in signal processing, finding applications in audio
synthesis, signal modulation, and various other domains where periodic or repetitive waveforms are
involved.

Program:
% Generation of Sawtooth signal
close all;
N = input ('Enter the length of the sequence:');
omega = 2*pi/5;
t = 0: omega:(N-1) *omega;
Y4 = sawtooth(t);
Subplot (3,2,5);
stem (t, Y4);
xlabel('Time');
ylabel('Amplitude');
title ('Sawtooth Signal');

Result:
Enter the length of the sequence: 5

Observation:
Sawtooth waves exhibit a linear rise and sudden drop pattern. They find use in applications requiring
periodic, ramp-like waveforms, such as audio synthesis, signal modulation, and generating unique
timbres in music synthesis.

Conclusion:
In this assignment, We learned how to generate and analyze different types of discrete-time
signals. These signals have various applications in signal processing, communication systems,
control systems, and many other fields.

You might also like