自适应FIR滤波器概述 所谓自适应滤波器, 能够根据输入信号的各种特性来调整自己的冲激响应. 通信应用中通常使用这种滤波器来消除干扰. 使用合适的自适应用算法可以自动检测干扰分量的频率特性,调整滤波器的系数从而在频率上对干扰进行带阻. 本文不探讨自适应算法的细节. 本例中使用一种自动回归算法(Auto Regressive), 此算法的输出即是一组FIR滤波器的系数. 该算法根据信号特点,信道参数和干扰特性对输出进行自动调整. 该算法的计算最好是在MCU空闲时由软件完成. 而对信号的过滤则必须在一定的延迟下连续进行. 此应用特性非常适合使用FMAC来加速. 本文中, 输入为已经采样,量化后存于MCU的存储器中的序列(每个序列长度为2048). 每次一个完整的采样序列准备好之后, DMA被触发将其输入给FMAC,FMAC对逐个采样进行滤波,输出由DMA再传输至存储器. 每个序列之间的间隔可用于更新滤波器系数. 自适应滤波器例子(序列1)下面展示采样序列1及其频谱, 输入信号为高斯噪音(或称”白噪音”), 有两个窄带干扰,分别位于8KHz和16KHz.信号的采样频率为48KHz. 生成上述信号的matlab代码: - % Specify the parameters of a signal with a sampling frequency of 1 kHz and a signal duration of 1.5 seconds.
- Fs = 48000; % Sampling frequency
- T = 1/Fs; % Sampling period
- L = 2^nextpow2(2048); % Length of signal
- t = (0:L-1)*T; % Time vector
- figure('name', 'Gaussian noise with two-tone interferer');
- % Form a signal containing a 50 Hz sinusoid of amplitude 0.7 and a 120 Hz sinusoid of amplitude 1.
- S1 = 0.8 * sin(2*pi*8000*t);
- S2 = 0.5 * sin(2*pi*16000*t);
- S = S1 + S2;
- subplot(4, 1, 1);
- plot(t(1:L/1)*1000, S1(1:L/1), 'red');
- title('8KHz');
- xlabel('t (milliseconds)')
- ylabel('S1(t)')
- subplot(4, 1, 2);
- plot(t(1:L/1)*1000, S2(1:L/1), 'magenta');
- title('16KHz');
- xlabel('t (milliseconds)')
- ylabel('S2(t)')
- subplot(4, 1, 3);
- plot(t(1:L/1)*1000, S(1:L/1), 'cyan')
- title('Signal')
- xlabel('t (milliseconds)')
- ylabel('S(t)')
- % Corrupt the signal with zero-mean white noise with a variance of 4.
- X = S + 2*randn(size(t));
- % Plot the noisy signal in the time domain. It is difficult to identify the frequency components by looking at the signal X(t).
- subplot(4, 1, 4);
- plot(t(1:L/1)*1000, X(1:L/1), 'green')
- title('Signal Corrupted with Zero-Mean Random Noise')
- xlabel('t (milliseconds)')
- ylabel('X(t)')
|