MATLAB Code For SAMPLING THEORM
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
%%% sampling theorm %%%%%%%%%%%%%5
%%% x= sin(2*pi*f1*n)+cos(2*pi*f2*n) %%%%
%%% with f1= 2/128 & f2 = 4/128 %%%%%
clc;
close all;
clear all;
f1=2/128;
f2=4/128;
n=0:255;
fc=50/128;
x=sin(2*pi*f1*n)+cos(2*pi*f2*n);
xa=cos(2*pi*fc*n);
xamp=x.*xa;
subplot(2,2,1);plot(n,x);title('x(n)');
xlabel('n -->');
ylabel('amplitude');
subplot(2,2,2);
plot(n,xa);
title('xa(n)');
xlabel('n -->');ylabel('amplitude');
subplot(2,2,3);plot(n,xamp);
xlabel('n -->');ylabel('amplitude');
%%%%%%%%%%%%%%%%%%%%%%%%
%%% sampling theorm %%%%%%%%%%%%%5
%%% x= sin(2*pi*f1*n)+cos(2*pi*f2*n) %%%%
%%% with f1= 2/128 & f2 = 4/128 %%%%%
clc;
close all;
clear all;
f1=2/128;
f2=4/128;
n=0:255;
fc=50/128;
x=sin(2*pi*f1*n)+cos(2*pi*f2*n);
xa=cos(2*pi*fc*n);
xamp=x.*xa;
subplot(2,2,1);plot(n,x);title('x(n)');
xlabel('n -->');
ylabel('amplitude');
subplot(2,2,2);
plot(n,xa);
title('xa(n)');
xlabel('n -->');ylabel('amplitude');
subplot(2,2,3);plot(n,xamp);
xlabel('n -->');ylabel('amplitude');
%%%%%%%%%%%%%%%%%%%%%%%%
sir can you upload matlab code for calculating maximium and minimium difference value.....
ReplyDelete