Wednesday, 27 May 2015

fft - STFT and DWT (Wavelets)


STFT can be successfully used on sound data (with a .wav soundfile for example) in order to do some frequency-domain modifications (example : noise removal).
With N=441000 (i.e. 10 seconds at sampling rate fs=44100), windowsize=4096, overlap=4, STFT produces approximatively a 430x4096 array (first coordinate : time frame, second coordinate : frequency bin). Modifications can be done on this array, and reconstruction can be done with overlap-add (*).


How is it possible to do a similar thing with wavelets ? (DWT), i.e. get a similar array of shape a x b, with a time frames, and b frequency bins, do some modification on this array, and at the end, recover a signal ? How ? What is the wavelet equivalent to overlap-add ? What would be the Python functions involved here (I haven't found an easy example of audio modification with pyWavelets...) ?


(*) : Here is the STFT framework that can be used :


signal = stft.Stft(x, 4096, 4)    # x is the input
modified_signal = np.zeros(signal.shape, dtype=np.complex)

for i in xrange(signal.shape[0]): # Process each STFT frame

modified_signal[i, :] = signal[i, :] * ..... # here do something in order to
# modify the signal in frequency domain !
y = stft.OverlapAdd(modified_signal, 4) # y is the output

The goal is to find a similar framework with wavelets.




No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...