0% found this document useful (0 votes)
9 views6 pages

Digital Signal Processing Lab 1

The document outlines a Digital Signal Processing lab experiment focused on waveform generation, specifically sine, triangular, and exponential waves. It includes MATLAB code for generating and plotting these waveforms in both continuous-time and discrete-time formats. The code demonstrates the use of subplots to visualize the different waveforms and their respective characteristics.

Uploaded by

bt24ece103
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)
9 views6 pages

Digital Signal Processing Lab 1

The document outlines a Digital Signal Processing lab experiment focused on waveform generation, specifically sine, triangular, and exponential waves. It includes MATLAB code for generating and plotting these waveforms in both continuous-time and discrete-time formats. The code demonstrates the use of subplots to visualize the different waveforms and their respective characteristics.

Uploaded by

bt24ece103
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

DIGITAL SIGNAL PROCESSING LAB 1

SIGNAL WAVEFORM GENERATION

CODE-

% Exp1- Waveform generation

% a)Sine Wave

% b)Triangular Wave

% c)Exponential

clc;

clear all;

close all;

%Sine Wave

f=1;

t=0:0.01:2;

x=sin(2*pi*f*t);

n=0:1:length(t)-1;

subplot(1,2,1)

plot(t,x)

xlabel('Time')

ylabel('Amplitude')

title('CTS')

grid on

subplot(1,2,2)

stem(n,x)

xlabel('Samples')

ylabel('Amplitude')
title('DTS')

grid on

sgtitle('SINE WAVE')

%Triangular Wave

%t=0:2;

%tr=[0,1,0];

%plot(t,tr);

%y=0:0.1:1;

%plot(y,y);

%n=0:1:length(y)-1;

%stem(n,y);

x1=[0:0.01:1]

x2=[0.99:-0.01:0]

x=[x1,x2]

t=0:0.01:2

n=0:length(t)-1

subplot(1,2,1)

plot(t,x)

xlabel('Time')

ylabel('Amplitude')

title('CTS')

grid on

subplot(1,2,2)

stem(n,x)

xlabel('Samples')
ylabel('Amplitude')

title('DTS')

grid on

sgtitle('TRIANGULAR WAVE')

%Exponential Signal

a = 1; % amplitude

b = 1.5; % growth/decay rate (change value to adjust shape)

t = 0:0.01:2; % time axis

x = a*exp(b*t); % exponential growing signal

%x = a*exp(-b*t); % exponential decaying signal

n = 0:1:length(t)-1;

subplot(1,2,1)

plot(t,x)

xlabel('Time')

ylabel('Amplitude')

title('CTS')

grid on

subplot(1,2,2)

stem(n,x)

xlabel('Samples')

ylabel('Amplitude')

title('DTS')

grid on

sgtitle('EXPONENTIAL SIGNAL')
OUTPUTS-

You might also like