clear;clc
%% Designing a decimation filter.
% We start by desinging a decimation filter in double precision. The
% decimation filter is a low pass filter with a decimation rate of 64. The
% filter specification is from the AD1877 Anolog Devices Sigma-Delta
% data sheet. You can find the data sheet at
% http://www.analog.com/UploadedFiles/Data_Sheets/AD1877.pdf
% The desing of the filter takes about 10 seconds. As such, for a faster
% start up the design is stored in a file. If you need to redesign the
% filter, simply uncomment the lines below and run the script.
Decimation_Factor=64;
Passband_Ripple=.006; %dB
Stopband_Attenuation=90; %dB
Fs=48e3;
Passband=21.6e3; %dB
Stopband=26.4e3; %dB
Input_Sampling_Rate = Decimation_Factor*Fs;
f=fdesign.decimator(Decimation_Factor,'lowpass',Passband,Stopband,...
Passband_Ripple,Stopband_Attenuation,Input_Sampling_Rate);
h=design(f);
save one_stage h
fvtool(h,'Fs',Input_Sampling_Rate);
%% To have a more efficnet implementation, we break down the filter into
hm=design(f,'multistage','Nstages',3);
save multi_stage hm
fvtool(h,'Fs',Input_Sampling_Rate);
%% We then convert the filter into fixed-point.
hf=hm;
hf.stage(1).Arithmetic = 'fixed';
hf.stage(1).CoeffWordLength = 24;
hf.stage(1).InputWordLength = 2;
hf.stage(1).InputFracLength = 0;
specifyall(hf.stage(1));
hf.stage(1).OutputWordLength = 12;
hf.stage(1).OutputFracLength = 10;
hf.stage(1).ProductWordLength = 8;
hf.stage(1).ProductFracLength = 10;
hf.stage(1).AccumWordLength = 13;
hf.stage(1).AccumFracLength = 10;
hf.stage(1).RoundMode = 'nearest';
hf.stage(2).Arithmetic = 'fixed';
hf.stage(2).CoeffWordLength = 24;
hf.stage(2).InputWordLength = 13;
hf.stage(2).InputFracLength = 10;
specifyall(hf.stage(2));
hf.stage(2).OutputWordLength = 13;
hf.stage(2).OutputFracLength = 10;
hf.stage(2).ProductWordLength = 10;
hf.stage(2).ProductFracLength = 10;
hf.stage(2).AccumWordLength = 13;
hf.stage(2).AccumFracLength = 10;
hf.stage(2).RoundMode = 'nearest';
hf.stage(3).Arithmetic = 'fixed';
hf.stage(3).CoeffWordLength = 24;
hf.stage(3).InputWordLength = 13;
hf.stage(3).InputFracLength = 10;
specifyall(hf.stage(3));
hf.stage(3).ProductWordLength = 11;
hf.stage(3).ProductFracLength = 12;
hf.stage(3).AccumWordLength = 14;
hf.stage(3).AccumFracLength = 12;
hf.stage(3).OutputWordLength = 16;
hf.stage(3).OutputFracLength = 15;
hf.stage(3).RoundMode = 'nearest';
hf.stage(3).OverflowMode = 'saturate';
save multi_stage_fixed hf
fvtool(hf,'Fs',Input_Sampling_Rate);
没有合适的资源?快使用搜索试试~ 我知道了~
delta-sigma toolbox
共16个文件
mexw32:4个
m:4个
mdl:4个
3星 · 超过75%的资源 需积分: 50 45 下载量 98 浏览量
2010-11-11
22:12:34
上传
评论
收藏 473KB ZIP 举报
温馨提示
matlab中用于仿真sigma-delta调制的工具箱,可用于A/D/A转换,音频、视频信号处理等
资源推荐
资源详情
资源评论
收起资源包目录
Sigma_Delta.zip (16个子文件)
Sigma_Delta
multi_stage.mat 5KB
high_level.mdl 88KB
high_level_sfun.mexw32 215KB
filter_design.m 3KB
multi_stage.mdl 94KB
multi_stage_sfun.mexw32 215KB
sigma_delta_control.m 343B
fixed_point.mdl 108KB
elaborated_design_sfun.mexw32 230KB
bin2sbin.m 180B
one_stage.mat 22KB
elaborated_design.mdl 111KB
multi_stage_fixed.mat 8KB
Readme.doc 27KB
generate_fir_lut.m 1KB
fixed_point_sfun.mexw32 230KB
共 16 条
- 1
资源评论
- realbinforever2013-03-12谢谢楼主,真心有用
- Lizuo68682018-01-08不能用,后面还去官网下了一个才行
dogrun
- 粉丝: 2
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功