資源簡介
音頻處理matlab代碼,配合mp3.pdf中介紹使用,共有6個代碼,其6
代碼片段和文件信息
function?[snr_value?shift]?=?snr(signalsignal_plus_noisemax_shiftshowplot)
%?[snr_value?shift]?=?snr(signalsignal_plus_noise?max_shiftshowplot)?returns?the
%?signal-to-noise?ratio?computed?from?the?input?signals.?|Max_shift|?gives
%?the?maximum?time-shift?(in?samples)?between?signal?and?signal_plus_noise.
%?The?actual?time-shift?(obtained?from?the?maximum?of?the?cross-correlation
%?and?returned?as?|shift|)?is?taken?into?account?to?estimate?the?noise.?If
%?signal?are?of?different?length?the?shortest?length?is?used.
%?If?|showplot|?is?specified?then?the?signal?signal_plus_noise?and?error?
%?are?plotted?and?the?SNR?is?printed?on?the?plot.
%?
%?T?DUTOIT?13:49?12/03/2007
sig_length=min(length(signal)length(signal_plus_noise));
sig_length=floor(sig_length/2)*2;?%?make?it?even
signal=signal(1:sig_length);?
signal_plus_noise=signal_plus_noise(1:sig_length);
len=min([max(10*max_shift1000)?sig_length-1]);
ha
- 上一篇:MP3原理和實現代碼5
- 下一篇:波浪力學中線性波的波長計算
評論
共有 條評論