Escolar Documentos
Profissional Documentos
Cultura Documentos
t=0:0.001:1;
f1=2;
sq=square(2*pi*f1*t);
subplot(3,1,1);
plot(t,sq);
xlabel('frequency');
ylabel('amplitude');
title('square signal');
f2=4;
si=sin(2*pi*f2*t);
subplot(3,1,2);
plot(t,si);
xlabel('frequency');
ylabel('amplitude');
title('sine signal');
z=length(sq);
for i=1:z
if(sq(i)==1)
r(i)=si(i);
else
r(i)=0;
end
end
subplot(3,1,3);
plot(t,r);
xlabel('frequency');
ylabel('amplitude');
title('ask signal');
TecAnz
TecAnz
%double clipper
t=0:0.001:1;
f=2;
si=sin(2*pi*f*t);
subplot(2,1,1);
plot(t,si);
xlabel('frequency');
ylabel('amplitude');
title('sine signal');
z=length(si);
for i=1:z
if(si(i)>.4)
r(i)=.4;
elseif(si(i)<-.3)
r(i)=-.3;
else
r(i)=si(i);
end
end
subplot(2,1,2);
plot(t,r);
xlabel('frequency');
ylabel('amplitude');
title('double clipped signal');
TecAnz
%sawtooth
t=0:0.0001:2;
y=t;
z=length(y);
for i=1:z
if(y(i)<1)
r(i)=y(i);
else
r(i)=y(i)-1;
end
end
subplot(1,1,1);
plot(t,r);
xlabel('frequency');
ylabel('amplitude');
title('sawtooth signal');
end
end
subplot(2,1,2);
plot(t,r);
xlabel('frequency');
ylabel('amplitude');
title('half wave rectified sig');
TecAnz
%rounding of no.
a=input('enter the no=','s'); %inputing no
si=numel(a); %to estimate the no.of digits
for i=1:si %to find the location of deci point
if(a(i)=='.') %chk for dec point
l=i; %found location
end
end
n=a(l+1); %first no. after decimel point
if(a(l+2)>'5')
n=n+1;
end
for i=1:si %re construction of rounded no.
b(i)=a(i);
if(a(i)=='.')
b(i+1)=n;
break
end
end
disp('no after operation:'),b
%sampling
t=0:0.001:1;
f=2;
si=sin(2*pi*f*t);
subplot(3,1,1);
plot(t,si);
xlabel('frequency');
ylabel('amplitude');
title('modulating signal');
fs=input('sampling frequency:');
ts=1/fs;
tx=0:ts:1;
ss=sin(2*pi*f*tx);
subplot(3,1,2);
stem(tx,ss);
xlabel('frequency');
ylabel('amplitude');
title('sampled signal');
subplot(3,1,3);
plot(tx,ss);
xlabel('frequency');
ylabel('amplitude');
title('reccovered signal');
TecAnz
%matrix multiplication
o1=input('enter the order of first matrix');%colum
seperated by ';'
o2=input('enter the order of seconf matrix');
if(o1(2)==o2(1))
disp('order of mul matrix is'),o1(1),o2(2)
A =input('enter the elements of first matrix');
B =input('enter the elements of second matrix')
C = A * B;%
disp('the multiplied out is'),C
else
disp('mat.multiplication not possible');
end
%triangular
t=0:0.0001:2;
y=t;
z=length(y);
for i=1:z
if(y(i)<1)
r(i)=y(i);
else
r(i)=2-y(i);
end
end
subplot(1,1,1);
plot(t,r);
xlabel('frequency');
ylabel('amplitude');
title('tring signal');
TecAnz
%sawtooth
t=0:0.0001:2;
y=t;
z=length(y);
for i=1:z
if(y(i)<1)
r(i)=y(i);
else
r(i)=y(i)-1;
end
end
subplot(1,1,1);
plot(t,r);
xlabel('frequency');
ylabel('amplitude');
title('sawtooth signal');
%clamping
t=0:0.001:1;
f=2;
si=sin(2*pi*f*t);
subplot(2,1,1);
plot(t,si);
xlabel('frequency');
ylabel('amplitude');
title('sine signal');
r=si+3;
subplot(2,1,2);
plot(t,r);
xlabel('frequency');
ylabel('amplitude');
title('clamped signal');
TecAnz
Ask
fsk
TecAnz
Psk
clamping
TecAnz
Doubl clipper
hwr
TecAnz
Positive clipper
TecAnz
sampling
Sawtooth sig
Double clipper
TecAnz