Sunday, 21 October 2018

New Interpolation Decimation Program_reg

Dear students,

New decimation  & Interpolation program without 'sinwave' function , Verify this program...... Most expected question in University practical examination.....


Interpolation:
clear all;
close all;
clc;
N=12; % sequence length
n=0:N-1;
% X=sin(2*pi*n/20)+sin(2*pi*n/15) %input sequence
X=[1,-1,1,-1, 2,-2,2,-2,3,-3,3,-3]; %input sequence
I=3; %up sampling factor
X1=zeros(1,I*N); 
j=1:I:I*N;
X1(j)=X;%up sampler output sequence
length(X1)
subplot(2,1,1)
stem(X)
subplot(2,1,2)
stem(X1)

Decimation:
clear all;

close all;
clc;

x=[1,-1,1,-1, 2,-2,2,-2,3,-3,3,-3];
n=length(x);
D=3;
y=x(1:D:n);
subplot(2,1,1)
stem(x);
subplot(2,1,2)
stem(y);
stem(y);



Regards
Rajesh.K
AP/ECE,
SSMIET