⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cicdecimation.m

📁 OFDM系统仿真
💻 M
字号:
%-------cic decimation filter 
%-------time   :2007-12-06
%-------name   : Wanyiping
%----R ratio change factor
%----M delay order of comb filter
%----N cascade stages num.

function    data_out=cicdecimation(data,R,M,N);

data_len=max(size(data));

s(1,1)=data(1);
for i=2:data_len
    s(i,1)=data(i)+s(i-1,1);
end

if N>1
    for j=2:N
        s(1,j)=s(1,j-1);
        for i=2:data_len
            s(i,j)=s(i,j-1)+s(i-1,j);
        end
    end
end

for i=1:data_len
    data_intp(i)=s(i,N);
end

down_data=downsample(data_intp,R,2);

down_data_len=max(size(down_data));

for i=1:M
    ds(i,1)=down_data(i);
end
for i=M+1:down_data_len
    ds(i,1)=down_data(i)-down_data(i-M);
end

if N>1
    for j=2:N
        for k=1:M
            ds(k,j)=ds(k,j-1);
        end
        for i=M+1:down_data_len
            ds(i,j)=ds(i,j-1)-ds(i-M,j-1);
        end
    end
end

data_out = ds(:,N);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -