Interpolation and decimation implementation
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!