我只是尝试使用.wav输出3个声音文件( wavwrite )。我在MATLAB中使用的数据使用soundsc播放声音很好,但由于某种原因,3个声音文件中有2个没有声音。
[data,Fs] = wavread('prj1.wav'); %Data file I read in
...%filtering with cascaded FIR filter
dataFiltered = filter(Hd,data); %applying filter to data
soundsc(dataFiltered,Fs) %plays perfectly
pause(6)
wavwrite(dataFiltered,Fs,'FIR_Cascade_Signal.wav'); %writes out perfectly, can play back fine.在此之后,我的问题出现了:
...%Filter with different method, simple IIR filter if curious
dataFiltered2 = filter(Gd,data); %applying second type of filter
soundsc(dataFiltered2,Fs) %plays back fine, loud and clear
pause(6)声音播放得很完美
wavwrite(dataFiltered2,Fs,'IIR_Cascade_Signal.wav');%Outputted file has NO SOUND写出一个声音文件,但什么也听不见
...%Filtering with notch filter. This uses dataFiltered2 as the first stage, and then filters out a 30Hz harmonic with the Notch filter
Yfilt_stage2 = filter(B,a,dataFiltered2);
soundsc(Yfilt_stage2,Fs); %Plays loud and clear, can hear everything
wavwrite(Yfilt_stage2,Fs,'Notch_Filtered_Signal.wav');%Again, no sound in output file任何帮助都将不胜感激!
发布于 2015-11-13 14:48:48
这是我电脑本身的问题。我在另一台电脑上尝试了我的代码,它运行得很好。
https://stackoverflow.com/questions/33531863
复制相似问题