简单的基追踪一维信号降噪方法(MATLAB 2018)

基追踪法是基于冗余过完备字典下的一种信号稀疏表示方法。该方法具有可提高信号的稀疏性、实现阈值降噪和提高时频分辨率等优点。基追踪法采用表示系数的范数作为信号来度量稀疏性,通过最小化l型范数将信号稀疏表示问题定义为一类有约束的极值问题,进而转化为线性规划问题进行求解。

Speech Signal Generation and Plot

M = 100;                  % length of signal
n = 0:M-1;
s = 0.5*sin(2*pi*0.05*n); % Speech Waveform 


% Plotting the speech Signal in Time Domain


figure(1)
subplot(2,1,1)
plot(n,s)
ylabel('Amplitude');
xlabel('Time');
title('Speech Waveform in Time Domain')


% Plotting the speech Signal in Frequency Domain


Y = (1/1024)*fft(s,1024);
figure(1)
subplot(2,1,2)
plot(abs(Y))
xlim([0 1024])
ylabel('Amplitude');
xlabel('Frequency');
title('Speech Waveform in Frequency Domain')

Noisy Signal Generation and Plot

w = 0.5*randn(size(s));    % w : zero-mean Gaussian noise
y = s + w;                 % y : Adding noise to speech signal


% Plotting the noisy Signal in Time Domain


figure(2)
subplot(2,1,1)
plot(y)
title('Noisy speech signal')
ylabel('Amplitude');
xlabel('Time');


% Plotting the noisy Signal in Frequency Domain


N = 2^10;                   % N : Length of Fourier coefficient vector
Y = (1/N)*fft(y,N);         % Y : Spectrum of noisy signal


figure(2)
subplot(2,1,2)
plot(abs(Y))
xlim([0 1024])
title('Fourier coefficients (FFT) of noisy signal');
xlabel('Frequency (index)')
[A, AH] = MakeTransforms('DFT', 100, 2^10)
% Defining algorithm parameters


lambda = 7; % lambda : regularization parameter
Nit = 50; % Nit : number of iterations
mu = 500; % mu : ADMM parameter


% Running the  BPD algorithm


[c, cost] = BPD(y, A, AH, lambda, mu, Nit);


figure(4)
plot(cost)
title('Cost function history');
xlabel('Iteration')
it1 = 5;
del = cost(it1) - min(cost);
ylim([min(cost)-0.1*del cost(it1)])
xlim([0 Nit])

Denoising

% Plotting the denoised Signal in Frequency Domain


figure(5)
subplot(2,1,1)
plot(abs(c))
xlim([0 1024])
title('Fourier coefficients (BPD solution)');
ylabel('Amplitude')
xlabel('Frequency')




% Plotting the denoised Signal in Time Domain


figure(5)
subplot(2,1,2)
plot(ifft(c))
xlim([0 100])
title('Denoised signal using BPD');
ylabel('Amplitude')
xlabel('Time')
相关推荐
重生之我在20年代敲代码26 分钟前
strncpy函数的使用和模拟实现
c语言·开发语言·c++·经验分享·笔记
爱上语文28 分钟前
Springboot的三层架构
java·开发语言·spring boot·后端·spring
m0_6090004235 分钟前
向日葵好用吗?4款稳定的远程控制软件推荐。
运维·服务器·网络·人工智能·远程工作
开MINI的工科男1 小时前
深蓝学院-- 量产自动驾驶中的规划控制算法 小鹏
人工智能·机器学习·自动驾驶
limingade3 小时前
手机实时提取SIM卡打电话的信令和声音-新的篇章(一、可行的方案探讨)
物联网·算法·智能手机·数据分析·信息与通信
编程零零七3 小时前
Python数据分析工具(三):pymssql的用法
开发语言·前端·数据库·python·oracle·数据分析·pymssql
AI大模型知识分享3 小时前
Prompt最佳实践|如何用参考文本让ChatGPT答案更精准?
人工智能·深度学习·机器学习·chatgpt·prompt·gpt-3
2401_858286114 小时前
52.【C语言】 字符函数和字符串函数(strcat函数)
c语言·开发语言
铁松溜达py4 小时前
编译器/工具链环境:GCC vs LLVM/Clang,MSVCRT vs UCRT
开发语言·网络
everyStudy4 小时前
JavaScript如何判断输入的是空格
开发语言·javascript·ecmascript