📄 test_mpeg.m
字号:
function Test_MPEG(wavePath)%% Main script - fs = 44100; bitrate = 128;% % Author: Michael Arnold (arnold@igd.fhg.de)% Fraunhofer Institute for Computer Graphics (IGD) %----------------------------------------------------------------------------%% Test_MPEG(wavePath) computes the minimum masking threshold LTMin.%% -- INPUT --% wavePath: Path to the WAVE files for calculating LTmin.% ----------- %% Load tables and global constantsglobal FFT_SIZE MIN_POWER NOT_EXAMINED IRRELEVANT TONAL NON_TONAL global TH INDEX BARK ATH SPL Map CB LTq load('Common_Const.mat');load('Tables_fs_44100.mat');% Input Wave file muss ein MONO File sein !!!UseGuiForInput = 1; % Specify NumberOfBandsNumberOfBands = 32;% DrawDRAW = 1;% Fetch name of input file and prepare name of output fileif UseGuiForInput % Set path to the wave files for testing. if isempty(wavePath), if isunix wavePath = '~/'; else wavePath = 'C:\'; end end % Get Filename and Path for Input-AudioFile [fname, pname] = uigetfile( strcat(wavePath,'*.wav') ,... 'WAVE file to analyze'); % Exit if user presses the cancel button if fname == 0 | pname == 0, return; end WavFile = strcat(pname, fname); else WavFile = wavePath;end% Loading the Wavfile, which should be MONO.[properties Fs bits] = wavread(WavFile, 'size'); samples = properties(1);channels = properties(2); if channels ~= 1 error('This test is only for MONO files!'); end % Loop over blocks of size FFT_SIZE for OFFSET = 1:FFT_SIZE:samples; Input = wavread(WavFile, [OFFSET OFFSET+511])'; % Psychoacoustic analysis %------------------------- [LTMin, Delta] = PsychoAcousticModel(Input, NumberOfBands); if (DRAW) plot(LTMin); title('Minimum masking threshold'); xlabel('Subband number'); ylabel('dB'); end keyInput = input('Press return to analyze block OR q to quit ...','s'); if ~isempty(keyInput) & keyInput == 'q', % Close figure close return; end end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -