Communication

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Codeofsampling.

clear all;
close all;
clc;

t = 0:0.001:0.3 ;
x = sin(2*pi*10*t) ;
plot(t,x);
fs = [20 50 100 200] ;
l = length(fs) ;
for i = 1:l
Ts = 1/fs(i) ;
ts = 0:Ts:0.3 ;
xs = sin(2*pi*10*ts) ;
subplot(2,2,i), stem(ts,xs);
clear ts ;
clear xs ;
end

reconsructionofsignal.m

clear all;
close all;
clc;
t = 0:0.001:0.3;
x = sin(2*pi*10*t);
plot(t,x);
fs = [20 50 100 200];
l = length(fs);
for i = 1:l
Ts = 1/fs(i) ;
ts = 0:Ts:0.3 ;
xs = sin(2*pi*10*ts) ;
y = interp1(ts,xs,t) ;
subplot(2,2,i), plot(t,y);
clear ts ;
clear xs ;
end

exp

clear all;
close all;
clc;
t = 0:0.001:0.35 ;
% x = sin(2*pi*10*t) + sin(2*pi*50*t) + sin(2*pi*100*t) ;
x=cos(2*pi*10)+2+sin(2*pi*20);
plot(t,x) ;
fs = [ 10 50 500 1000 2000 750] ;
l = length(fs);
for i = 1:l
Ts = 1/fs(i) ;
ts = 0:Ts:0.35 ;
xs = cos(2*pi*10*ts)+2+sin(2*pi*20*ts) ;
y = interp1(ts,xs,t) ;
subplot(3,3,i), plot(t,y);
clear ts ;
clear xs ;
clear y ;
end

code of 2/03/2023
clear all;
close all;
clc;
x1=[4 2 6 3 8 1 5];
n1=[-2:4];% generating index
x2=[3 8 6 9 6 7];
n2=[-4:1];
kmin=n1(1)+n2(1);% left edge of convolved result
kmax=n1(end)+n2(end); % right edge of convolved result
y=conv(x1,x2);
k=kmin:kmax; % generating index of the result
subplot(311),stem(n1,x1)
subplot(312),stem(n2,x2)
subplot(313),stem(k,y)

[3/27, 10:18 pm] Md.kaium howlader: close all;


clear all;
clc;
t = 0:0.001:0.1 ;
x = 3*sin(1000*t)+4*cos(1000*t) ;
plot(t,x);
fs = [20 50 100 500] ;
l = length(fs) ;
for i = 1:l
ts = 1/fs(i) ;
ts = 0:ts:0.1 ;
xs = 3*sin(1000*ts)+4*cos(1000*ts) ;
subplot(2,2,i), stem(ts,xs,'r');
clear ts ;
clear xs ;
end
[3/27, 10:18 pm] Md.kaium howlader: close all;
clear all;
clc;
b=[1 2 0];
a=[1 5 6];
zplane(b,a)
[3/27, 10:18 pm] Md.kaium howlader: close all;
clear all;
clc;
syms a n f;
f=a^n;
ztrans(f)

You might also like