Interpolation and decimation implementation

조회 수: 1 (최근 30일)
atif javed
atif javed 2018년 2월 6일
I am trying to implement interpolation and decimation without using build in functions for this purpose i follow the following sequence
upsampling->filter (interpolation)
filter->downsample (Decimation)
for interpolation filter i use fir interpolation and for decimation i use window hamming method but the problem is whenever i handle the group delay my symobls are reduced. So what should i do to handle this problem.
My code is written below
clc;
clear all;
close all;
idata=ones(1,100);
nfilt=30;
upfac = 10;
alpha = 0.5;
xr = upsample(idata,upfac);
h1 = intfilt(upfac,2,alpha);
y = filter(h1,1,xr);
delay = mean(grpdelay(h1));
y(1:delay) = [];
[B,A]=fir1(30,1/10);
nfilt = nfilt+1;
itemp = 2*idata(1) - idata((nfilt+1):-1:2);
[itemp,zi]=filter(B,1,itemp); %#ok
dec_filter=filter(B,A,y,zi);
delay = mean(grpdelay(B));
dec_filter(1:delay) = [];
dec=downsample(dec_filter,10);
xx=decimate(y,10,'fir');

답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by