我有一个(音频)信号。我连续应用 STFT,在应用一定幅度阈值后,我正在做逆 STFT 来重建信号。但是在整个重建的音频中,我得到了一些不需要的迷你噪声尖峰。
在时频域中,如果它超过某个阈值,我只是将值归零。我也在做 STFT 时应用 Hanning 的窗口。里面有什么问题?
这个想法很简单:
for(int i=0; i<total_samples ; i+=hopsize){
for(int j=0; j<frame.size(); j++){
apply_hanning_window(frame[j]);
}
stft_frame = apply_STFT(frame);
reconstructed_overlapping_frame = apply_INVERSE_STFT(stft_frame);
reconstructed_audio.push(reconstructed_overlapping_frame);
}
apply_INVERSE_STFT(stft_frame){
Iterate_over_fullframe(){
if(stft_frame[i].magnitude > threshold) stft_frame[i] = 0; // applying magnitude threshold
// I can also apply frequency threshold here
}
filtered_frame = do_INVERSE_STFT(stft_frame):
return filtered_frame;
}
如果我做错了什么,请告诉我。谢谢