简单的基追踪一维信号降噪方法(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')
相关推荐
guslegend17 小时前
第6节:OCR文本错漏频发?结合LLM纠错,让图像文本也能精确使用
人工智能·大模型·ocr·rag
PD我是你的真爱粉17 小时前
大模型可控性实践:护栏技术、结构化输出、GPT Structured Outputs 与 GPTCache
人工智能·gpt
这张生成的图像能检测吗17 小时前
(论文速读)基于知识图谱构建的大型工业设备故障诊断模型
人工智能·深度学习·知识图谱·故障诊断
#卢松松#17 小时前
腾讯云宣布涨价
人工智能·创业创新
ccLianLian17 小时前
深度学习基础·损失函数
人工智能·深度学习
reasonsummer17 小时前
【教学类-160-04】20260411 AI视频培训-练习4“万相AI视频《逐光而笑》+豆包图片风格:人像摄影”
人工智能·通义万相
卷福同学17 小时前
去掉手机APP开屏广告,李跳跳2.2下载使用
java·后端·算法
大空大地202617 小时前
程序调试与异常处理
开发语言
俊哥V17 小时前
每日 AI 研究简报 · 2026-04-11
人工智能·ai
二等饼干~za89866817 小时前
源码可控:云罗 GEO 源头工厂,开源搭建 + 二次开发全链路解决方案
服务器·开发语言·开源·php·音视频·ai-native