基本跟踪法是基于冗余完整字典下的信号稀疏表示方法。该方法具有提高信号稀疏性、降低阈值噪音、提高时频分辨率等优点。基本跟踪方法以表示系数的范数作为信号来衡量稀疏性,将信号稀疏表示问题定义为一种具有约束力的极值问题,然后转化为线性规划问题来解决。
Speech Signal Generation and Plot
M = 100; % length of signaln = 0:M-1;s = 0.5*sin(2*pi*0.05*n); % Speech Waveform % Plotting the speech Signal in Time Domainfigure(1)subplot(2,1,1)plot(n,s)ylabel('Amplitude');xlabel('Time');title('Speech Waveform in Time Domain')% Plotting the speech Signal in Frequency DomainY = (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 noisey = s w; % y : Adding noise to speech signal% Plotting the noisy Signal in Time Domainfigure(2)subplot(2,1,1)plot(y)title('Noisy speech signal')ylabel('Amplitude');xlabel('Time');% Plotting the noisy Signal in Frequency DomainN = 2^10; % N : Length of Fourier coefficient vectorY = (1/N)*fft(y,N); % Y : Spectrum of noisy signalfigure(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 parameterslambda = 7; % lambda : regularization parameterNit = 50; % Nit : number of iterationsmu = 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 Domainfigure(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 Domainfigure(5)subplot(2,1,2)plot(ifft(c))xlim([0 100])title('Denoised signal using BPD');ylabel('Amplitude')xlabel('Time')
完整代码:https://mbd.pub/o/bread/mbd-ZZmVmJlv
知乎学术咨询:https://www.zhihu.com/consult/people/792359672131756032?isMe=1专业领域:现代信号处理、机器学习、深度学习、数字孪生、时间序列分析、设备缺陷检测、设备异常检测、设备智能故障诊断和健康管理PHM等。
评论列表 (0条)