脉冲成形滤波器设计
2011-01-03 16:20
330 查看
用17阶的FIR滤波器
先用mallab产生FIR滤波器的参数和查表法要使用到的初始化数据
y=rcosfir(0.3,2,4,1/1e3,'sqrt');
y =
Columns 1 through 10
0.0283 -0.0191 -0.0768 -0.0974 -0.0375 0.1113 0.3077 0.4752 0.5410 0.4752
Columns 11 through 17
0.3077 0.1113 -0.0375 -0.0974 -0.0768 -0.0191 0.0283
刚刚思考了一下,对于一个5阶的滤波器来说 只有以下几种可能
11111
11110
11100
11000
10000
00000
00001
00011
00111
01111
共10种情况
对于一个13阶梯的滤波器 也只有26种情况
matlab代码如下:
x=[33 -45 -113 -43 202 494 625 494 202 -43 -113 -45 33];
a=[-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1];
for i=1:26
out(i)=a*x';
for j=1:12
a(14-j)=a(13-j);
end
if (i<14)a(1)=1;
else a(1)=-1;
end
a
end
out=floor(out/2017*511)+512;
生成如下的波形:
再做一个ROM:
代码如下:
module rcoslist(
clk,
add,
dataout
);
input clk;
input [12:0]add;
output [9:0]dataout;
reg [9:0]dataout;
always@(posedge clk)
case (add)
13'b0000000000000: dataout<=86;
13'b0000000000001: dataout<=102;
13'b0000000000011: dataout<=80;
13'b0000000000111: dataout<=22;
13'b0000000001111: dataout<=1;
13'b0000000011111: dataout<=103;
13'b0000000111111: dataout<=353;
13'b0000001111111: dataout<=670;
13'b0000011111111: dataout<=920;
13'b0000111111111: dataout<=1023;
13'b0001111111111: dataout<=1001 ;
13'b0011111111111: dataout<=943 ;
13'b0111111111111: dataout<=921 ;
13'b1111111111111: dataout<=937 ;
13'b1111111111110: dataout<=921 ;
13'b1111111111100: dataout<=943 ;
13'b1111111111000: dataout<=1001 ;
13'b1111111110000: dataout<=1023 ;
13'b1111111100000: dataout<=920 ;
13'b1111111000000: dataout<=670;
13'b1111110000000: dataout<=353 ;
13'b1111100000000: dataout<=103;
13'b1111000000000: dataout<=1;
13'b1110000000000: dataout<=22 ;
13'b1100000000000: dataout<=80 ;
13'b1000000000000: dataout<=102;
endcase
测试代码如下:
module rcostest;
// Inputs
reg datain;
reg clock_1k;
// Outputs
wire [9:0] dataout;
wire [12:0] addra;
// Instantiate the Unit Under Test (UUT)
rcosfilter uut (
.datain(datain),
.dataout(dataout),
.clock(clock_1k),
.addra(addra)
);
initial begin
// Initialize Inputs
datain = 0;
clock_1k = 0;
#260 datain=1;
#260 datain=0;
#260 datain=1;
#260 datain=0;
#260 datain=0;
#260 datain=1;
#260 datain=1;
#260 datain=0;
#260 datain=1;
end
always
#10 clock_1k=~clock_1k;
最后用modelsim仿真 波形如下:
先用mallab产生FIR滤波器的参数和查表法要使用到的初始化数据
y=rcosfir(0.3,2,4,1/1e3,'sqrt');
y =
Columns 1 through 10
0.0283 -0.0191 -0.0768 -0.0974 -0.0375 0.1113 0.3077 0.4752 0.5410 0.4752
Columns 11 through 17
0.3077 0.1113 -0.0375 -0.0974 -0.0768 -0.0191 0.0283
刚刚思考了一下,对于一个5阶的滤波器来说 只有以下几种可能
11111
11110
11100
11000
10000
00000
00001
00011
00111
01111
共10种情况
对于一个13阶梯的滤波器 也只有26种情况
matlab代码如下:
x=[33 -45 -113 -43 202 494 625 494 202 -43 -113 -45 33];
a=[-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1];
for i=1:26
out(i)=a*x';
for j=1:12
a(14-j)=a(13-j);
end
if (i<14)a(1)=1;
else a(1)=-1;
end
a
end
out=floor(out/2017*511)+512;
生成如下的波形:
再做一个ROM:
代码如下:
module rcoslist(
clk,
add,
dataout
);
input clk;
input [12:0]add;
output [9:0]dataout;
reg [9:0]dataout;
always@(posedge clk)
case (add)
13'b0000000000000: dataout<=86;
13'b0000000000001: dataout<=102;
13'b0000000000011: dataout<=80;
13'b0000000000111: dataout<=22;
13'b0000000001111: dataout<=1;
13'b0000000011111: dataout<=103;
13'b0000000111111: dataout<=353;
13'b0000001111111: dataout<=670;
13'b0000011111111: dataout<=920;
13'b0000111111111: dataout<=1023;
13'b0001111111111: dataout<=1001 ;
13'b0011111111111: dataout<=943 ;
13'b0111111111111: dataout<=921 ;
13'b1111111111111: dataout<=937 ;
13'b1111111111110: dataout<=921 ;
13'b1111111111100: dataout<=943 ;
13'b1111111111000: dataout<=1001 ;
13'b1111111110000: dataout<=1023 ;
13'b1111111100000: dataout<=920 ;
13'b1111111000000: dataout<=670;
13'b1111110000000: dataout<=353 ;
13'b1111100000000: dataout<=103;
13'b1111000000000: dataout<=1;
13'b1110000000000: dataout<=22 ;
13'b1100000000000: dataout<=80 ;
13'b1000000000000: dataout<=102;
endcase
测试代码如下:
module rcostest;
// Inputs
reg datain;
reg clock_1k;
// Outputs
wire [9:0] dataout;
wire [12:0] addra;
// Instantiate the Unit Under Test (UUT)
rcosfilter uut (
.datain(datain),
.dataout(dataout),
.clock(clock_1k),
.addra(addra)
);
initial begin
// Initialize Inputs
datain = 0;
clock_1k = 0;
#260 datain=1;
#260 datain=0;
#260 datain=1;
#260 datain=0;
#260 datain=0;
#260 datain=1;
#260 datain=1;
#260 datain=0;
#260 datain=1;
end
always
#10 clock_1k=~clock_1k;
最后用modelsim仿真 波形如下:
相关文章推荐
- [数字信号处理]IIR滤波器的直接设计(C代码)
- 滤波器设计指标
- 关于Matlab中用fdatool设计滤波器
- 滤波器和衰减器的电路设计
- 利用 SCILAB 设计 FIR 滤波器(Minimax法)
- Python在信号与系统中的应用(1)——Hilbert变换,Hilbert在单边带包络检波的应用,FIR_LPF滤波器设计,还有逼格高高的FM(PM)调制
- MATLAB信号处理仿真-基带脉冲成形的数字滤波器
- Matlab滤波器设计
- 基于FPGA与MATLAB的IIR滤波器设计与实现
- 一种传感器的信号分析和滤波器设计
- 4.5 matlab 设计IIR滤波器
- 用Matlab设计一个带通有限长FIR冲激响应滤波器
- Android UI设计之<十四>自定义ViewGroup,实现绚丽的仿支付宝咻一咻雷达脉冲效果
- ads 滤波器设计仿真中的一个要点
- 数字信号处理实验(五)——IIR滤波器的设计
- Matlab fdatool设计滤波器
- 滤波器的使用与设计
- matlab 进行滤波器设计方法
- 基于模型设计的FPGA开发与实现:滤波器设计与实现(一)在Matlab中高效设计滤波器
- mel滤波器算法设计