Re: Synthesis from a spectrogram
- From: "Michel Rouzic" <Michel0528@xxxxxxxx>
- Date: 9 Apr 2006 09:31:17 -0700
Andor wrote:
Michel Rouzic wrote:
Andor wrote:
Michel Rouzic wrote:
I made a program that makes a spectrogram out of a sound (with log base
2 frequency) output it as an image file and then is able to input it
again to turn it back into a sound. However, I'm meeting a problem.
In order to make the spectrogram, I bandpass the original sound many
times with an array of filters which frequency and width vary
logarithmically and get the enveloppe out of each band. In order to
turn the spectrogram (the image) back into a sound, I generate a white
noise, filter it in the exact same way as I filtered the original
sound, and multiply each of these bands with the enveloppe from the
image matching to that band.
While the sound is recognizibly reconstructed, the result is quite
noise, the main problem being that there is noise in areas where they
should not. In other words, I'm not really sure that using this
technique (I mean using noise and filter it) might be the best way, but
I cannot think of any other. Any ideas?
I would proceed as follows: Make a filter bank such that you can
reconstruct the original signal from the filter bank output with the
appropriate synthesis filters. Wouldn't that be great? If you don't
modify the signal in frequency domain, the output signal is _exactly_
the same as the input signal!
Now Michel, this has of course all been done before. Its called the
Wavelet Transform. Look for a two-channel orthogonal or biorthogonal WT
to get the log2 base frequency division.
I'm sure the code is out there ...
(use Mulder's voice to read this last sentence:-)
Wait, there's something that I don't understand here. I read about
wavelet transforms since you posted, and it sounds somewhat close to
what I do, but there's something wrong tho, in order to perform the
inversion wavelet transform, you're supposed to do it with bands that
have been obtained by filtering and downsampling (downsampling is a
detail tho), what i'm trying to say is that I don't keep all that,
since I only keep the envelope for each band. So I still don't
understand how I reconstruct my signal with only that..
Of course, if you only keep the envelope of the filter bank output,
then you lose information, and you won't be able to reconstruct your
signal. However, I don't know what you hope gain from just keeping the
envelope instead of the signed signal. If you define envelope(x) =
abs(x), then this kind of irreversible data compression saves you only
one bit of memory per sample ...
This is definitly not about compression, far from that. It's about
editing (editing the spectrogram, understand, the image, instead of
directly editing the sound, and i really hope you're not wondering "why
would anyone wanna do that?").
btw to me envelope(x)!=abs(x) but rather
envelope(x)=downsample(abs(upwards_frequency_shift(upsample(x))))
so yeah, i'm not hoping to gain anything by just keeping the envelope
but as you can guess since the goal is to produce a spectrogram I can't
leave the filtered signals as is. I'm not trying to get to the exact
original signal but something close enough.
I'm already get interesting results by using a white noise but I don't
think this is good enough, and I hardly can think of any alternative.
Of course, the way I get the spectrogram itselves could be changed, but
it would still have to be a spectrogram, therefore I think it will
still have to be made of envelopes
.
- References:
- Synthesis from a spectrogram
- From: Michel Rouzic
- Re: Synthesis from a spectrogram
- From: Andor
- Re: Synthesis from a spectrogram
- From: Michel Rouzic
- Re: Synthesis from a spectrogram
- From: Andor
- Synthesis from a spectrogram
- Prev by Date: Plotting amplitude spectra of PWM based on Double Fourier Series
- Next by Date: Re: Something astray in my FFT understanding
- Previous by thread: Re: Synthesis from a spectrogram
- Next by thread: Re: Synthesis from a spectrogram
- Index(es):
Relevant Pages
|