资源简介
音频处理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
- 下一篇:波浪力学中线性波的波长计算
评论
共有 条评论