赞
踩
在图像处理过程中,图像噪声对图像的后续处理和清晰度影响较大.因此,对图像的降噪至关重要.随着小波变换的不断优化,小波变换广泛应用在图像降噪方面.该文基于软阈值的小波图像增强方法,通过实验论述小波变换在图像去噪中的应用.
转存失败重新上传取消
%实验要求二:小波硬阈值语音降噪
clear all; clc; close all;
[xx, fs] = wavread('C5_4_y.wav'); % 读入数据文件
xx=xx-mean(xx); % 消除直流分量
x=xx/max(abs(xx)); % 幅值归一化
N=length(x);
%-------------------------加入指定强度的噪声---------------------------------
SNR=5;
s=awgn(x,SNR,'measured','db'); % 叠加噪声
wname='db7';
jN=6; %分解的层数
snrs=20*log10(norm(x)/norm(s-x));
signal=Wavelet_Hard(s,jN,wname);
signal=signal/max(abs(signal));
snr1=SNR_Calc(x,s); % 计算初始信噪比
snr2=SNR_Calc(x,signal); % 计算降噪后的信噪比
snr=snr2-snr1;
fprintf('snr1=%5.4f snr2=%5.4f snr=%5.4f\n',snr1,snr2,snr);
% 作图
time=(0:N-1)/fs; % 设置时间
subplot 311; plot(time,x,'k'); grid; axis tight;
title('纯语音波形'); ylabel('幅值')
subplot 312; plot(time,s,'k'); grid; axis tight;
title(['带噪语音 信噪比=' num2str(SNR) 'dB']); ylabel('幅值')
subplot 313; plot(time,signal,'k');grid;%hold on;
title('滤波后波形'); ylabel('幅值'); xlabel('时间/s');
%--------------------------------------------------------------------------
[1]付炜, 李方胜. 小波阈值法在语音去噪中的应用[J]. 电子技术, 2010.
部分理论引用网络文献,若有侵权联系博主删除。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。