Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How to deal with the overlap when constructing signal from frequency d (Read 12572 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to deal with the overlap when constructing signal from frequency d

All,here is 2 questions  about constrcuting signal from frequency domain. Any comments are appreciated.

1. omitted!
2. Another question is about dealing with overlap when reconstrcuting signal from frequency.

Enframe time speech signal windowed with overlap, and transmit it into frquency ,filtered and speech enhanced ... ,and back to time. When reconstrcuting it,how to deal with the overlap parts? Just use one of overlap (overlap save),or add all of overlap parts(overlap add,it maybe 2,3...and more). ? If overlap add, should I scale it? how to scale? whether it should use overlap save or overlap add,it is related to whether signal windowed or not?

How to deal with the overlap when constructing signal from frequency domain?

cheers
hyeewang

How to deal with the overlap when constructing signal from frequency d

Reply #1
It seems you forgot to do the 50% overlap. Also, if you intend on actually modifying the signal between the fft and the ifft, it's best to apply the window both before the fft and after the ifft. You need a "power complementary" window for that. The simplest is sqrt(Hanning), which is just a sine window. Note that you *can't* use a Hamming window in any case.

How to deal with the overlap when constructing signal from frequency d

Reply #2
It seems you forgot to do the 50% overlap. Also, if you intend on actually modifying the signal between the fft and the ifft, it's best to apply the window both before the fft and after the ifft. You need a "power complementary" window for that. The simplest is sqrt(Hanning), which is just a sine window. Note that you *can't* use a Hamming window in any case.


Tkank you, jmvalin.

It seemed that u are talking my 1st question.
It is willfully that I "forget" overlap for testing the effect of windowing. The difference between the 2 turns is windowing only. But at the 1st turn, the reconstructed signal sound well,in contrast with the 2nd turn bad effect. It must be windowing which corrupt the signal.

Again,you talked about power complementary window ,which simplest is sqrt(Hanning). How apply it after ifft?  divide the window?  signal/ sqrt(hanning)?
Why hamming window can not use as power complementary window? I know the fact that sqrt(hanning) is a sine window and hamming is not.

cheers

How to deal with the overlap when constructing signal from frequency d

Reply #3
It is willfully that I "forget" overlap for testing the effect of windowing. The difference between the 2 turns is windowing only. But at the 1st turn, the reconstructed signal sound well,in contrast with the 2nd turn bad effect. It must be windowing which corrupt the signal.


You're multiplying your signal times a periodically extended hanning function.  This should change the way the signal sounds quite a lot.  Were you expecting something else?

How to deal with the overlap when constructing signal from frequency d

Reply #4

It is willfully that I "forget" overlap for testing the effect of windowing. The difference between the 2 turns is windowing only. But at the 1st turn, the reconstructed signal sound well,in contrast with the 2nd turn bad effect. It must be windowing which corrupt the signal.


You're multiplying your signal times a periodically extended hanning function.  This should change the way the signal sounds quite a lot.  Were you expecting something else?


Thank you. It maybe be the answer for  the 1st question.
It is true that I am  multiplying signal times a periodically extended hanning function. And that change the way the signal sounds quite a lot. But I am exepcting it sound as well as original signal.

Since windowing change the signal badly,why we always insist on windowing the signal,just eliminateing the spectrum leakage. Windowing can contaminate signal,and nonwindowing cause spectrum leakage. How to make it tradeoff?

cheers

How to deal with the overlap when constructing signal from frequency d

Reply #5
What is it that you want to do?

Since ifft(fft(x))=x you don't need to think about the FFT to answer the first question.

Regarding window functions: Yes, if you intend to modify the "FFT data" somehow you should use a window prior FFT and after iFFT with 50% overlap and an appropriate window like jmvalin suggested. But neither hann, hanning, hamming, nor the square-root versions of these are appropriate.

Try Vorbis' window:

function w = vorbiswin(n)
w = sin((pi/2).*sin(pi.*((0.5:n)'./n)).^2);
return;

If you just want to filter your signal (as in convolution) you might want to drop the whole windowing thing. There's no need for it in case you know exactly the filter's impulse response's length.

Cheers!
SG

How to deal with the overlap when constructing signal from frequency d

Reply #6
What is it that you want to do?

Since ifft(fft(x))=x you don't need to think about the FFT to answer the first question.

Regarding window functions: Yes, if you intend to modify the "FFT data" somehow you should use a window prior FFT and after iFFT with 50% overlap and an appropriate window like jmvalin suggested. But neither hann, hanning, hamming, nor the square-root versions of these are appropriate.

Try Vorbis' window:

function w = vorbiswin(n)
w = sin((pi/2).*sin(pi.*((0.5:n)'./n)).^2);
return;

If you just want to filter your signal (as in convolution) you might want to drop the whole windowing thing. There's no need for it in case you know exactly the filter's impulse response's length.

Cheers!
SG


Thank you.

Your comment is right ,I have omitted the first queston due it's bad logic.

I am just thinking how to handle the overlap when reconstrcuted speech signal from frequency domain.

In a speech enhancement system, such as spectral subtraction algo applied, speech signal ,windowed if

applied,is enframed with overlap, and transmitted to frequency domain by fft. Then subtract the estimated

noise variance from signal spectrum,...  back to time domain by ifft. When reconstruct speech signal, how to

handle the overlap? Just use one of overlap (overlap save),or add all of overlap parts(overlap add,it maybe

2,3...and more). ? If overlap add, should I scale it? how to scale? whether it should use overlap save or

overlap add,it is related to whether signal windowed or not?


Another puzzles:

a. if 10% overlap is applied,not 50%,which kinds of window should be used?

b. if use window before fft (multiplication), how to use window function after ifft?

How to deal with the overlap when constructing signal from frequency d

Reply #7
I would ask the same question already asked: What are you talking about?

When you are talking about percentage of overlap I guess you are calculating Short Time Fourier Transform (STFT) or Time-Dependant Fourier Transform. In this case using window functions with Constant Over-Lap-Add Property and accordingly a proper overlap you can calculate a sampled approximation to the Discrete Time Fourier Transform of the analyzing signal and of course to analyze the signal. When using Inverse Fourier Transform you can get as many time points as frequency bins are there in the spectrum. So, not an infinite long signal.

When you are talking about a “reconstructing of speech signal” I guess you need to reconstruct a long signal.
In a case you want to process an infinite long signal with a finite filter (SebastianG mentioned this) then, I think, another techniques are used: overlap-add and overlap-save methods. This approach is described very well in Discrete-Time Signal Processing by Alan V. Oppenheim and Ronald W. Schafer and the implementation is straightforward.
If you have questions about that most probably I could answer them.

How to deal with the overlap when constructing signal from frequency d

Reply #8
I would ask the same question already asked: What are you talking about?

When you are talking about percentage of overlap I guess you are calculating Short Time Fourier Transform (STFT) or Time-Dependant Fourier Transform. In this case using window functions with Constant Over-Lap-Add Property and accordingly a proper overlap you can calculate a sampled approximation to the Discrete Time Fourier Transform of the analyzing signal and of course to analyze the signal. When using Inverse Fourier Transform you can get as many time points as frequency bins are there in the spectrum. So, not an infinite long signal.

When you are talking about a “reconstructing of speech signal” I guess you need to reconstruct a long signal.
In a case you want to process an infinite long signal with a finite filter (SebastianG mentioned this) then, I think, another techniques are used: overlap-add and overlap-save methods. This approach is described very well in Discrete-Time Signal Processing by Alan V. Oppenheim and Ronald W. Schafer and the implementation is straightforward.
If you have questions about that most probably I could answer them.

Thank you!
hehe, reaching somebody's heart is so difficult !?

---I would ask the same question already asked: What are you talking about?

What am I talking about? Ok. I answer it once more,although I have speaked it for servral times.
I suppose a speech enhancement system. Speech signal  would be enframed into many frames with overlap,
maybe windowed also. Then calculate FFT (refer to your Short Time Fourier Transform) to get the spectrum
of the frame. After subtract the estimated noise variance from spectrum , apply a ifft algo to back to
time domain. Finally,get the reconstructed and denoised speech signal by "concatenating" all the frame.   

----When you are talking about percentage of overlap I guess you are calculating Short Time Fourier Transform (STFT) or Time-Dependant Fourier Transform. In this case using window functions with Constant Over-Lap-Add Property and accordingly a proper overlap you can calculate a sampled approximation to the Discrete Time Fourier Transform of the analyzing signal and of course to analyze the signal. When using Inverse Fourier Transform you can get as many time points as frequency bins are there in the spectrum. So, not an infinite long signal.

1. here, what is "window functions with Constant Over-Lap-Add Property"?
2. Surely,the signal length after ifft(Inverse Fourier Transform) is as many as frequency bins.
  It is not doubtful. But they are overlapped. You can not get the reconstruted speech signal by directly
  concatenate all the frames. Then how to concatenate them?

---When you are talking about a “reconstructing of speech signal” I guess you need to reconstruct a long signal.
In a case you want to process an infinite long signal with a finite filter (SebastianG mentioned this) then, I think, another techniques are used: overlap-add and overlap-save methods. This approach is described very well in Discrete-Time Signal Processing by Alan V. Oppenheim and Ronald W. Schafer and the implementation is straightforward.
If you have questions about that most probably I could answer them.

---  Your guess is right.I need to reconstruct a long signal. I knows both overlap-add and overlap-save methods.
    But, should I use overlap-add ,or overlap-save,or others, when reconstructing the frame signal ? How to decide it?

Thank you anyway.
Best Wishes

HyeeWang

How to deal with the overlap when constructing signal from frequency d

Reply #9
When you modify the transform, it is the same as convolving the signal with the resulting time-domain signal from the ifft of the modification signal.

You need enough overlap, which includes zeros before and after the analysis window, so that you can overlap by enough to account for the actual time-domain length of the effective impulse response you are creating in the frequency domain.

You can use a Hann window on the analysis side, and no window on the reconstruction side, just overlap-add, if your second signal is appropriately conditioned, too.
-----
J. D. (jj) Johnston

How to deal with the overlap when constructing signal from frequency d

Reply #10
When you modify the transform, it is the same as convolving the signal with the resulting time-domain signal from the ifft of the modification signal.

You need enough overlap, which includes zeros before and after the analysis window, so that you can overlap by enough to account for the actual time-domain length of the effective impulse response you are creating in the frequency domain.

You can use a Hann window on the analysis side, and no window on the reconstruction side, just overlap-add, if your second signal is appropriately conditioned, too.


Thank you Woodinville.
I reached your blog. You achived a lot regarding audio processing,especially perceptual coding.
Give my respects to you.

It is you who told the essence of this thread. That is the method of reconstructing signal from frequency into time domain.
You mentioned the overlap-add method with no window, that is also I found in many matlab script programs which implement algo such as spectral subtrction etc.

But you did not tell the principle of why using overlap-add.

---You need enough overlap, which includes zeros before and after the analysis window, so that you can overlap by enough to account for the actual time-domain length of the effective impulse response you are creating in the frequency domain.

And, I do not get how to add zero before overlap. I guess according your comments: If I wanna a L points overlap,I should add L/2 points zeros before and after the frame(windowed). right?

Give My Respects
hyeeWang

How to deal with the overlap when constructing signal from frequency d

Reply #11
But you did not tell the principle of why using overlap-add.


Well, I implied it, but perhaps I need to be more specific.

You need "overlap add" so that the circular property of the FFT does not time-alias the processed signal.

The "zeros" are simply added outside the window length, on both ends of the window or one, depending on how the modification signal is designed.  You just window, add zeros, and take a longer FFT. Then you use a longer IFFT after processing, and add the overlapping part.

For some kinds of interesting filterbanks, you use things like 3/4 or 7/8 overlap, i.e. the impulse repsonse is much longer than one block of data.

Oh, and the length of a sequence 'm' when convolved with an impulse response oflength 'n' is m+n-1  so that's the minimum length of your FFT.
-----
J. D. (jj) Johnston

How to deal with the overlap when constructing signal from frequency d

Reply #12
My apologies if it's somewhat off-topic, but what are the benefits and drawbacks to using a DCT instead of FFT in this sort of application?

How to deal with the overlap when constructing signal from frequency d

Reply #13
My apologies if it's somewhat off-topic, but what are the benefits and drawbacks to using a DCT instead of FFT in this sort of application?


Different frequency interpretation, different rate gain. Note, different. Win some, lose some.
-----
J. D. (jj) Johnston

How to deal with the overlap when constructing signal from frequency d

Reply #14
Thank you Woodinville

Maybe I must pay attention to time aliasing due to circular property of the FFT .  Before, I only realized time
alising resided in reconstrcuted signal by downsampling signal with higher frequency components.

cheers