在matlab中将音频转换为无重叠帧

时间:2017-05-03 15:22:37

标签: matlab audio-processing

这是我编写的用于在Dct转换后将音频转换为帧的代码 首先,我必须将音频样本转换为Dct频率 第二,我必须分成几个部分 然后将每个段分成四个帧  下面的代码是我尝试但在for循环它不工作或给出错误的值 我需要不重叠的帧 有人知道吗? 有人能帮助我吗?

%Original Audio Signal Dct Conversion

%Original_audio input
[filename , pathname] = uigetfile({'*.wav'}, 'Select File');
fullpathname = strcat (pathname, filename);
[original_audio, Fs] = audioread(fullpathname);

%Do DCT Transform for Original Audio
original_audio_dct = abs(dct(original_audio));
audio_length=length(original_audio_dct);

%%
%original Audio Signal segmentation

fs=44100;
segment_duration = 0.01;
segment_length = segment_duration*fs;
no_segment = floor(audio_length/segment_length);

 for k = 1 : no_segment 
   for j = 1:no_segment
   segment(j)= original_audio_dct((k-1)*segment_length+1:k*segment_length);

     for n = 1:4
         frame_length = floor(length(segment)/4);
         frame = segment(frame_length+1:2*frame_length);
        max_val = max(frame);


     end
    end
  end

0 个答案:

没有答案