|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
%%%%%% CIC filter parameters %%%%%%
R = 4; %% Decimation factor
M = 1; %% Differential delay
N = 8; %% Number of stages
B = 18; %% Coeffi. Bit-width
Fs = 91.392e6; %% (High) Sampling freq in Hz before decimation
Fc = 4.85e6; %% Pass band edge in Hz
%%%%%%% fir2.m parameters %%%%%%
L = 110; %% Filter order; must be even
??????Fo = R*Fc/Fs; %% Normalized Cutoff freq; 0<Fo<=0.5/M;
%%%%%%% CIC Compensator Design using fir2.m %%%%%%
p = 2e3; %% Granularity
s = 0.25/p; %% Step size
fp = [0:s:Fo]; %% Pass band frequency samples
fs = (Fo+s):s:0.5; %% Stop band frequency samples
f = [fp fs]*2; %% Normalized frequency samples; 0<=f<=1
Mp = ones(1,length(fp)); %% Pass band response; Mp(1)=1
Mp(2:end) = abs( M*R*sin(pi*fp(2:end)/R)./sin(pi*M*fp(2:end))).^N;
Mf = [Mp zeros(1,length(fs))];
f(end) = 1;
h = fir2(L,f,Mf); %% Filter length L+1
h = h/max(h); %% Floating point coefficients
hz = round(h*power(2,B-1)-1);
在altera官网中有这样一段代码,用的是反sinc补偿,前面打问号的那句实在是想不通,归一化频率不应该是直接除以fs吗?为什么前面要乘以R?去掉R的话算出来的结果又不对,请各位解答 |
|