以下是从Matlab的帮助文档里摘来的滤波器Demo。

滤波器、均衡器,我就不多说了。

前面有系列文章,滤波器的设计。如LMS滤波器、经典FIR滤波器等。

这里直接使用Matlab的工具箱。

Choose an Adaptive Algorithm.Configuring an equalizer involves choosing an adaptive algorithm and indicating your choice when creating an equalizer object in the MATLAB environment.

Although the best choice of adaptive algorithm might depend on your individual situation,here are some generalizations that might influence your choice:

The LMSalgorithm executes quickly but converges slowly, and its complexity grows linearly with the number of weights.

The RLSalgorithm converges quickly, but its complexity grows with the square of the number of weights, roughly speaking. This algorithm can also be unstable when the number of weights is large.

The varioustypes of signed LMSalgorithms simplify hardware implementation.

The normalized LMS and variable-step-size LMS algorithms are more robust to variability of the input signal's statistics (such as power).

The constant modulus algorithm is useful when no training signal is available, andworks best for constant modulus modulationssuch as PSK.

However, if CMA has no additional side information, it can introduce phase ambiguity. For example, CMA might find weights that produce a perfect QPSK constellation but might introduce a phase rotation of 90, 180, or 270 degrees. Alternatively, differential modulation can be used to avoid phase ambiguity.

基本步骤

% Build a set of test data.

hMod = comm.BPSKModulator; % BPSKModulator System object

x = step(hMod,randi([0 1],1000,1)); % BPSK symbols

rxsig = conv(x,[1 0.8 0.3]); % Received signal

% Create an equalizer object.

eqlms = lineareq(8,lms(0.03));

% Change the reference tap index in the equalizer.

eqlms.RefTap = 4;

% Apply the equalizer object to a signal.

y = equalize(eqlms,rxsig,x(1:200));

In this example,eqlmsis an equalizer object that describes a linear LMS equalizer having eight weights and a step size of 0.03. At first, the reference tap index in the equalizer has a default value, but assigning a new value to the propertyeqlms.RefTapchanges this index. Finally, theequalizecommand uses theeqlmsobject to equalize the signalrxsigusing the training sequencex(1:200).

恒定步长LMS

% The following code illustrates how to use

% equalize with a training sequence.

% The training sequence in this case is just

% the beginning of the transmitted message.

% Set up parameters and signals.

M = 4; % Alphabet size for modulation

msg = randi([0 M-1],1500,1); % Random message

hMod = comm.QPSKModulator('PhaseOffset',0);

modmsg = step(hMod,msg); % Modulate using QPSK.

trainlen = 500; % Length of training sequence

chan = [.986; .845; .237; .123+.31i]; % Channel coefficients

filtmsg = filter(chan,1,modmsg); % Introduce channel distortion.

% Equalize the received signal.

eq1 = lineareq(8, lms(0.01)); % Create an equalizer object. % 8 taps,lms算法,步长0.01

eq1.SigConst = step(hMod,(0:M-1)')'; % Set signal constellation. % 标准星座图

[symbolest,yd] = equalize(eq1,filtmsg,modmsg(1:trainlen)); % Equalize. % 均衡器obj,需要均衡的信号,训练序列

% Plot signals.

h = scatterplot(filtmsg,1,trainlen,'bx'); hold on;

scatterplot(symbolest,1,trainlen,'g.',h);

scatterplot(eq1.SigConst,1,0,'k*',h);

legend('Filtered signal','Equalized signal',...

'Ideal signal constellation');

hold off;

% Compute error rates with and without equalization.

hDemod = comm.QPSKDemodulator('PhaseOffset',0);

demodmsg_noeq = step(hDemod,filtmsg); % Demodulate unequalized signal.

demodmsg = step(hDemod,yd); % Demodulate detected signal from equalizer.

hErrorCalc = comm.ErrorRate; % ErrorRate calculator

ser_noEq = step(hErrorCalc, ...

msg(trainlen+1:end), demodmsg_noeq(trainlen+1:end));

reset(hErrorCalc)

ser_Eq = step(hErrorCalc, msg(trainlen+1:end),demodmsg(trainlen+1:end));

disp('Symbol error rates with and without equalizer:')

disp([ser_Eq(1) ser_noEq(1)])

eq1 =

EqType: 'Linear Equalizer'

AlgType: 'LMS'

nWeights: 8

nSampPerSym: 1

RefTap: 1

SigConst: [1x4 double]

StepSize: 0.0100

LeakageFactor: 1

Weights: [1x8 double]

WeightInputs: [1x8 double]

ResetBeforeFiltering: 1

NumSamplesProcessed: 1500

The example goes on to determine how many errors occur in trying to recover the modulated message with and without the equalizer. The symbol error rates, below, show that the equalizer improves the performance significantly.

Symbol error rates with and without equalizer:

0 0.3410

The example also creates a scatter plot that shows the signal before and after equalization, as well as the signal constellation for QPSK modulation. Notice on the plot that the points of the equalized signal are clustered more closely around the points of the signal constellation.

RLS算法

原理摘自于张贤达的《现代信号处理》,清华大学出版社。

省去了一些,放了一些基本思想上来。完整过程请自行阅读有关内容。

The rls function creates an adaptive algorithm object that you can use with the lineareq function or dfe function to create an equalizer object. You can then use the equalizer object with theequalize function to equalize a signal. To learn more about the process for equalizing a signal, see Adaptive Algorithms.

alg = rls(forgetfactor) constructs an adaptive algorithm object based on the recursive least squares (RLS) algorithm. The forgetting factor is forgetfactor, a real number between 0 and 1. The inverse correlation matrix is initialized to a scalar value.

alg = rls(forgetfactor,invcorr0)sets the initialization parameter for the inverse correlation matrix. This scalar value is used to initialize or reset the diagonal elements of the inverse correlation matrix

%% 均衡算法 Demo

% qcy

% matlab自带RLS

% 2017年5月17日15:50:46

clear;

close all;

clc

%%

% The following code illustrates how to use

% equalize with a training sequence.

% The training sequence in this case is just

% the beginning of the transmitted message.

% Set up parameters and signals.

M = 16; % Alphabet size for modulation

msg = randi([0 M-1],2400,1); % Random message

hMod = comm.RectangularQAMModulator(M);

modmsg = step(hMod,msg); % Modulate using M-QAM.

trainlen = 1000; % Length of training sequence

chan = [.986; .845; .237; .123+.31i]; % Channel coefficients

% chan = [1 0.45 0.3+0.2i]; % Channel coefficients

filtmsg = filter(chan,1,modmsg); % Introduce channel distortion.

% Equalize the received signal.

% eq1 = lineareq(40, lms(0.002)); % Create an equalizer object. % 8 taps,lms算法,步长0.01

eq1 = lineareq(40, rls(0.99,0.1)); % Create an equalizer object. % 40 taps,RLS算法,步长0.99,自相关矩阵逆矩阵的对角线初值InvCorrInit

eq1.SigConst = step(hMod,(0:M-1)')'; % Set signal constellation. % 标准星座图

[symbolest,yd] = equalize(eq1,filtmsg,modmsg(1:trainlen)); % Equalize. % 均衡器obj,需要均衡的信号,训练序列

% Plot signals.

h = scatterplot(filtmsg,1,trainlen,'bx'); hold on;

scatterplot(symbolest,1,trainlen,'g.',h);

scatterplot(eq1.SigConst,1,0,'k*',h);

legend('Filtered signal','Equalized signal',...

'Ideal signal constellation');

hold off;

% Compute error rates with and without equalization.

hDemod = comm.RectangularQAMDemodulator(M);

demodmsg_noeq = step(hDemod,filtmsg); % Demodulate unequalized signal.

demodmsg = step(hDemod,yd); % Demodulate detected signal from equalizer.

hErrorCalc = comm.ErrorRate; % ErrorRate calculator

ser_noEq = step(hErrorCalc, ...

msg(trainlen+1:end), demodmsg_noeq(trainlen+1:end));

reset(hErrorCalc)

ser_Eq = step(hErrorCalc, msg(trainlen+1:end),demodmsg(trainlen+1:end));

disp('Symbol error rates with and without equalizer:')

disp([ser_Eq(1) ser_noEq(1)])

看起来似乎可以完美均衡一样。

close all;

Nfft = 66536;

CHAN = fft(chan,Nfft);

figure;

subplot(211);

plot(abs(CHAN(1:Nfft/2)));

title('真实信道')

subplot(212);

EQ = fft(eq1.Weights,Nfft);

plot(1./abs(EQ(1:Nfft/2)));

title('估计信道')

rls自适应滤波器matlab实现,Matlab自适应滤波器设计Demo——LMS,RLS相关推荐

  1. matlab 自适应噪声对消,基于Matlab的RLS自适应语音噪声对消系统的设计与实现

    基于Matlab 的R LS 自适应语音噪声 对消系统的设计与实现 ① 肖 哲 (湖南工业大学科技学院, 湖南株洲 412008) 摘 要:自适应信号处理的理论和技术经过40多年的发展和完善,已逐渐成 ...

  2. matlab中卡尔曼滤波,卡尔曼滤波器和matlab代码.doc

    完美WORD格式 专业整理分享 信息融合大作业 --维纳最速下降法滤波器,卡尔曼滤波器设计及Matlab仿真 时间:2010-12-6 专业:信息工程 班级学号:2007302171 姓名:马志强 滤 ...

  3. matlab中多边形滤波器,几种常见空间滤波器MATLAB实现

    本文链接:https://blog.csdn.net/LYduring/article/details/80443573 一.目的 实现算术均值滤波器.几何均值滤波器.中值滤波器.修正的阿尔法均值滤波 ...

  4. matlab编程实现自适应均值滤波和自适应中值滤波

    matlab编程实现自适应滤波器 一.自适应均值滤波器 1. 原理部分: 2. 程序代码 3. 结果对比 二.自适应中值滤波 1. 原理部分 2.程序代码 3. 结果对比 一.自适应均值滤波器 1. ...

  5. 双线性变换 matlab,matlab和双线性变换的滤波器设计.doc

    matlab和双线性变换的滤波器设计.doc 武汉理工大学MATLAB课程设计报告书题目MATLAB课程设计基于MATLAB和双线性变换的滤波器设计初始条件MATLAB仿真软件数字信号处理与图像处理基 ...

  6. 基于MATLAB FDATOOL的CIC滤波器设计

    级联积分梳状(CIC)滤波器是一种被广泛应用于软件无线电中,可以实现抽取或者插值的高效滤波器.它主要用于降低或提高采样率.CIC滤波器的主要特点是,仅利用加法器.减法器和寄存器,占用资源少,实现简单且 ...

  7. 【MATLAB教程案例1】通信系统中成形滤波器原理的MATLAB设计实现

    FPGA教程目录 MATLAB教程目录 -------------------------------------------------------------------------------- ...

  8. 【CIC滤波器】基于MATLAB/FPGA的数字CIC滤波器的设计

    FPGA代码: module down(i_clk,//输入时钟i_rst,//输入复位信号i_M, //抽取值i_data,//输入信号o_data,//输出信号r_clk);input i_clk ...

  9. 【Matlab】扩展卡尔曼滤波器原理及仿真(初学者入门专用)

    文章目录 0.引言及友情链接 1.场景预设 2.扩展卡尔曼滤波器 3.仿真及效果 0.引言及友情链接 \qquad卡尔曼滤波器(Kalman Filter, KF)是传感器融合(Sensor Fusi ...

  10. Matlab滤波器的verilog实现,FIR滤波器的Verilog实现

    设计总结 FIR简介 用Verilog实现FIR需要注意的问题? 2.1 浮点数和定点数之间的转换 2.2 利用FilterDesigner设计FIR 2.3 Matlab仿真分析 2.4 补码问题 ...

最新文章

  1. 来,一起手撸一个简版 Redis(附源码)
  2. Linux PuTTY 更改字体
  3. 【控制】《多智能体系统一致性与复杂网络同步控制》郭凌老师-目录
  4. mysql 禁止插入重复数据_防止MySQL重复插入数据的三种方法
  5. 我的世界服务器linux加mod,在Linux下搭建带MOD 我的世界(Minecraft)服务器
  6. Linux之ls命令
  7. Django 前后端数据传输、ajax、分页器
  8. TCP/IP源码分析
  9. ZLMediaKit+wvp-GB28181-pro,搭建28181协议视频平台
  10. centos安装udp,tcp的测试工具
  11. 木讷的程序员需要知道的事情(一)
  12. python结巴分词 每个词一行,python-结巴分词+词云展示
  13. 他把自己估值上万亿美元的项目免费化了.....
  14. 编译原理(4):语法分析(自上而下)
  15. CST学习笔记1--------CST基础建模
  16. JavaScript 按字母顺序排列对象数组
  17. 前端开发 html第二课 自结束标签 注释 标签中的属性 文档声明 进制 字符编码 文档使用 VScode 实体 meta标签 语义化标签 块元素和行内元素 布局标签
  18. 人脸表情识别概述(一)
  19. 计算机一级理论课及答案,计算机一级考试理论题及答案课案.doc
  20. 微型计算机测控系统课程设计报告,微机原理课程设计实验报告--步进电机控制.docx...

热门文章

  1. Minecraft Forge 安装
  2. IT项目管理的实例与总结
  3. java幸运观众抽取_Java利用数组随机抽取幸运观众如何实现
  4. linux记账软件下载,速手记账app安卓版下载-速手记账软件官方版v1.1.7-Linux公社
  5. 3.Python标准库—math库的使用
  6. soui 设置边框_第三十四篇:在SOUI中使用异步通知
  7. 微信小程序项目开发--打卡签到
  8. 《基于运算放大器和模拟集成电路的电路设计》PDF云盘资源分享
  9. Android基于串口通讯笔记(USB,485协议,232协议)
  10. 焕然一新的 Vue 3 中文文档来了,附送50张学习思维图