?? matlab_butterfilter.txt
字號:
Fs = 500;
Fn = Fs/2;
Fco = 150;
filtdes = fdesign.lowpass('n,fc', 32, Fco, Fs);
Hd = butter(filtdes);
Hd = convert(Hd, 'df1sos');
fvtool(Hd, 'Fs', Fs, 'FrequencyScale', 'log');
Hd.arithmetic = 'fixed';
Hd.InputWordLength = 12;
Hd.InputFracLength = 7;
Hd.OutputWordLength = 12;
Hd.OutputMode = 'SpecifyPrecision';
Hd.OutputFracLength = 7;
Hd.CoeffWordLength = 12;
Hd.AccumWordLength = 20;
Hd.NumStateWordLength = 20;
Hd.DenStateWordLength = 20;
Hd.CastBeforeSum = false;
Hd.RoundMode = 'round';
Hd.OverflowMode = 'wrap';
fvtool(Hd, 'Fs', Fs, 'FrequencyScale', 'log');
Hd.CoeffWordLength = 16;
fvtool(Hd, 'Fs', Fs, 'FrequencyScale', 'log');
axis([0 1.0 -1 1]);
scales = Hd.scalevalues .* 2^Hd.InputFracLength
% Now scale the filter using the frequency domain infinity norm.
scale(Hd,'Linf');
% After scaling, the scale value are all one in this case.
scales = Hd.scalevalues
workingdir = tempname;
generatehdl(Hd,'Name', 'hdlbutter', 'TargetLanguage', 'VHDL',...
'TargetDirectory', workingdir);
edit(fullfile(workingdir, 'hdlbutter.vhd'));
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -