0% found this document useful (0 votes)
11 views

Function Experiment

The document defines functions to generate continuous and discrete sine, power, and exponential waves over time. It discretizes the power and exponential wave functions and plots the continuous and discrete versions of each on subplots to compare them.

Uploaded by

Gp
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Function Experiment

The document defines functions to generate continuous and discrete sine, power, and exponential waves over time. It discretizes the power and exponential wave functions and plots the continuous and discrete versions of each on subplots to compare them.

Uploaded by

Gp
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

function Experiment_part1(f,phi,fs,T)

f = 1/(2*pi);
phi = 0;
fs = 10/pi;
T = 10*pi;
%%Continuous sine wave function
t_cont = 0:0.001:T;
w_cont = 2*pi*f;

%%Continuous power wave function


subplot(2,2,1);
Plot1 = 2.^(t_cont);
plot(t_cont,Plot1); grid on
title('Geethika Puvvala : 20EE10056 : Continuous Power Wave Function')
xlabel('Time')
ylabel('Function Value')

%%Discretization of power wave


subplot(2,2,2);
t_discrete = linspace(0,T,T*fs+1);
Plot2 = 2.^(t_discrete);
plot(t_discrete,Plot2); grid on
stem(t_discrete,Plot2)
title('Geethika Puvvala : 20EE10056 : Discrete Power Wave Function')
xlabel('Time')
ylabel('Function Value')

%%Continuous exponential wave function


subplot(2,2,3);
Plot1 = exp((-1)*t_cont);
plot(t_cont,Plot1); grid on
title('Geethika Puvvala : 20EE10056 :Continuous Exponential Function')
xlabel('Time')
ylabel('Function Value')

%%Discretization of exponential wave function


subplot(2,2,4);
t_discrete = linspace(0,T,T*fs+1);
Plot2 = exp((-1)*t_discrete);
plot(t_discrete,Plot2); grid on
stem(t_discrete,Plot2)
title('Geethika Puvvala : 20EE10056 :Discrete Exponential Function')
xlabel('Time')
ylabel('Function Value')

You might also like