-
大小: 2KB文件類型: .m金幣: 1下載: 0 次發布日期: 2021-01-04
- 語言: Matlab
- 標簽: MATLAB??statmoments??
資源簡介
function [v,unv]=statmoments(p,n)
% STATMOMENTS Computes statistical central moments of image histogram.
% [v,unv]=statmoments(p,n) computes up to the Nth statistical
% central moment of a histogram whose components are in vector
% P. The length of must equal 256 or 65536.
% ****from ggbondg****
% T
代碼片段和文件信息
clear??????????????????????????????%清空內存及清屏
clc
%%?原始信號
Fs=44101;??????????????????????????%音頻信號采樣率
signal?=?wavread(‘test.wav‘);??????%讀入信號
figure??????????????????????????????
plot(signal);??????????????????????%畫出原始音頻信號的波形
title(‘原始音頻信號‘)
%msgbox(‘正在播放原始音頻信號!‘);??%彈出提示框
%wavplay(signalFs)?????????????????%播放原始音頻信號
FFT_NUM?=?65536;
freq?=?(-FFT_NUM/2:1:FFT_NUM/2-1)/FFT_NUM*Fs/1e3;
freq2_val?=?fft(?signal??FFT_NUM)/Fs;??????????%做FFT求出頻譜
freq2_val=freq2_val.*conj(freq2_val)/FFT_NUM*Fs;
SpecVal(1:FFT_NUM/2)?=?freq2_val(FFT_NUM/2+1:FFT_NUM);
SpecVal(FFT_NUM/2+1:FFT_NUM)?=?freq2_val(1:FFT_NUM/2);?
figure
plot(?freq?10*log10(?abs(SpecVal))?);grid
%%?帶噪信號
SNR=30;????????????????????????????%設置信噪比
noise=10^(-SNR/10)*(randn(size(signal)));?
b=firlvbo(2565e3FsFs‘hpf‘);
評論
共有 條評論