Forums

Simple Sample Repetition?

Started by Cranisch January 20, 2014
Ok guys, i am a mechanical engineer...so please forgive me if i get messed
up with some DSP terms ;-)

I have the following issue:
From a test bench measurement in a speed runup I have obtained an air-borne
sound signal with a microphone (sampling rate 48kHz). I need to extract a
stationary sound signal for one specific speed out of the "continuous"
speed runup.

Therefore, i have tried the following procedure (MATLAB):
1. Performed a block-wise FFT with 8192 and without windowing or
overlapping
2. Identified the right block that represents my requested speed
3. Applied an IFFT in order to get a time-signal for this block (length
8192)
4. Copied the time-signal many times with a 50%-overlap in order to build
up the desired length of the stationary signal 

Now what i get is a sound signal with the right frequency content but with
some odd "artifacts". That means, when I listen to the result file I hear
periodic "bumps". The periodity of the bumps correlate with the FFT size
and the overlap. When I use a significant larger FFT size of 32768 the
bumps occure more seldom and the intensity is reduced a little bit.
But I can not select a very large FFT size because of the averaging effect
of frequencies due to the fact that the original signal comes from a
continuous speed runup.

So, I need your help:
Do I use the right method for my task?
What can be done to avoid these artifacts?
Is there an easier way to synthesize such a signal?

Thanks in advance!
Christian

	 

_____________________________		
Posted through www.DSPRelated.com
Cranisch <99289@dsprelated> wrote:
> Ok guys, i am a mechanical engineer...so please forgive me if i > get messed up with some DSP terms ;-)
> I have the following issue: > From a test bench measurement in a speed runup I have obtained > an air-borne sound signal with a microphone (sampling rate 48kHz). > I need to extract a stationary sound signal for one specific speed > out of the "continuous" speed runup.
> Therefore, i have tried the following procedure (MATLAB): > 1. Performed a block-wise FFT with 8192 and without windowing or > overlapping
You might need windowing.
> 2. Identified the right block that represents my requested speed
> 3. Applied an IFFT in order to get a time-signal for this block > (length 8192)
Presumably you get back what went into the FFT.
> 4. Copied the time-signal many times with a 50%-overlap in order > to build up the desired length of the stationary signal
I understand using the FFT to find the block with the appropriate frequency. There might be other ways to find the block, then ... The result is similar to making a loop tape (or video) splicing the end back to the beginning. It will often cut in the middle of a word, resulting in a discontinuity. In frequency terms, and remember that the FFT by definition transforms a periodic function, there is often a discontinuity where the splice is. Discontinuites have lots of high frequency components, even if the actual signal has none of them, and, audibly makes a tick sound. Windowing (other than a rectangular window) is similar to the fade in/fade out that DJs use when transitioning between songs. If you use a smoother window, such that one fades in while the other fades out, and the spectral content isn't too narrow, it might work. If the spectrum is too narrow, the transition won't work right. Consider a pure tone, a sine wave, and where the phase doesn't match. As you fade from one to the other, there will be an interference term, such that the amplitude decreases. -- glen
On Mon, 20 Jan 2014 05:37:35 -0600, Cranisch wrote:

> Ok guys, i am a mechanical engineer...so please forgive me if i get > messed up with some DSP terms ;-) > > I have the following issue: > From a test bench measurement in a speed runup I have obtained an > air-borne sound signal with a microphone (sampling rate 48kHz). I need > to extract a stationary sound signal for one specific speed out of the > "continuous" speed runup. > > Therefore, i have tried the following procedure (MATLAB): > 1. Performed a block-wise FFT with 8192 and without windowing or > overlapping 2. Identified the right block that represents my requested > speed 3. Applied an IFFT in order to get a time-signal for this block > (length 8192) > 4. Copied the time-signal many times with a 50%-overlap in order to > build up the desired length of the stationary signal > > Now what i get is a sound signal with the right frequency content but > with some odd "artifacts". That means, when I listen to the result file > I hear periodic "bumps". The periodity of the bumps correlate with the > FFT size and the overlap. When I use a significant larger FFT size of > 32768 the bumps occure more seldom and the intensity is reduced a little > bit. > But I can not select a very large FFT size because of the averaging > effect of frequencies due to the fact that the original signal comes > from a continuous speed runup. > > So, I need your help: > Do I use the right method for my task? > What can be done to avoid these artifacts? > Is there an easier way to synthesize such a signal?
What you've done is a really convoluted way of taking a block of sound from the engine and playing it back over and over on top of itself. Here's something to try. It may not work, but it's easy so if it doesn't you haven't lost much: I'd start by windowing the thing with a raised cosine or some other window that, when overlapped and added, was constant. Then I'd do the "play back over and over again" thing purely in the time domain and see what it sounded like. You may or may not like the results. I think the second thing I'd try would be to extract the PSD of the sound, then regenerate it using random noise through a "motor-shaped" filter. Beyond that -- I dunno. I'll bet there's a whole science to generating motor noise; I know it's a closed book to me. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
On Mon, 20 Jan 2014 05:37:35 -0600, "Cranisch" <99289@dsprelated>
wrote:

>Ok guys, i am a mechanical engineer...so please forgive me if i get messed >up with some DSP terms ;-) > >I have the following issue: >From a test bench measurement in a speed runup I have obtained an air-borne >sound signal with a microphone (sampling rate 48kHz). I need to extract a >stationary sound signal for one specific speed out of the "continuous" >speed runup. > >Therefore, i have tried the following procedure (MATLAB): >1. Performed a block-wise FFT with 8192 and without windowing or >overlapping >2. Identified the right block that represents my requested speed >3. Applied an IFFT in order to get a time-signal for this block (length >8192) >4. Copied the time-signal many times with a 50%-overlap in order to build >up the desired length of the stationary signal > >Now what i get is a sound signal with the right frequency content but with >some odd "artifacts". That means, when I listen to the result file I hear >periodic "bumps". The periodity of the bumps correlate with the FFT size >and the overlap. When I use a significant larger FFT size of 32768 the >bumps occure more seldom and the intensity is reduced a little bit. >But I can not select a very large FFT size because of the averaging effect >of frequencies due to the fact that the original signal comes from a >continuous speed runup. > >So, I need your help: >Do I use the right method for my task? >What can be done to avoid these artifacts? >Is there an easier way to synthesize such a signal? > >Thanks in advance! >Christian > > > >_____________________________ >Posted through www.DSPRelated.com
There will be discontinuities between the ends of the files, so an easy thing to do is taper the ends (perhaps with a window like a raised cosine). If you taper the ends and then adjust the overlap so that the sum of the overlapped tapers is always 100%, it goes a long way toward masking some of the artifacts. This won't eliminate the basic periodicity, but it should help. Sometimes the length of the tapered part can be short, e.g., for an 8k block taper 100 points on each end, then overlap by 50 (assuming the taper is at 50% in the middle of the region). Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
>On Mon, 20 Jan 2014 05:37:35 -0600, "Cranisch" <99289@dsprelated> >wrote: > >>Ok guys, i am a mechanical engineer...so please forgive me if i get
messed
>>up with some DSP terms ;-) >> >>I have the following issue: >>From a test bench measurement in a speed runup I have obtained an
air-borne
>>sound signal with a microphone (sampling rate 48kHz). I need to extract
a
>>stationary sound signal for one specific speed out of the "continuous" >>speed runup. >> >>Therefore, i have tried the following procedure (MATLAB): >>1. Performed a block-wise FFT with 8192 and without windowing or >>overlapping >>2. Identified the right block that represents my requested speed >>3. Applied an IFFT in order to get a time-signal for this block (length >>8192) >>4. Copied the time-signal many times with a 50%-overlap in order to
build
>>up the desired length of the stationary signal >> >>Now what i get is a sound signal with the right frequency content but
with
>>some odd "artifacts". That means, when I listen to the result file I
hear
>>periodic "bumps". The periodity of the bumps correlate with the FFT size >>and the overlap. When I use a significant larger FFT size of 32768 the >>bumps occure more seldom and the intensity is reduced a little bit. >>But I can not select a very large FFT size because of the averaging
effect
>>of frequencies due to the fact that the original signal comes from a >>continuous speed runup. >> >>So, I need your help: >>Do I use the right method for my task? >>What can be done to avoid these artifacts? >>Is there an easier way to synthesize such a signal? >> >>Thanks in advance! >>Christian >> >> >> >>_____________________________ >>Posted through www.DSPRelated.com > >There will be discontinuities between the ends of the files, so an >easy thing to do is taper the ends (perhaps with a window like a >raised cosine). If you taper the ends and then adjust the overlap so >that the sum of the overlapped tapers is always 100%, it goes a long >way toward masking some of the artifacts. This won't eliminate the >basic periodicity, but it should help. > >Sometimes the length of the tapered part can be short, e.g., for an 8k >block taper 100 points on each end, then overlap by 50 (assuming the >taper is at 50% in the middle of the region). > > >Eric Jacobsen >Anchor Hill Communications >http://www.anchorhill.com >
Ok, thank you very much for your fast replying. Do that's what I understood so far: 1. I should apply a window on to the blocks before transforming into frequency domain 2. Identify my relevant (speed) block 3. IFFT that block and overlap several of these blocks in a tapered way (e.g. a windowed like raised cosine - is there any standard window doing that? i saw the Planck-taper and the Tukey window on wikipedia) Did I get you right? Don't I need the same window for the 1st step (FFT) or should it be sufficient only for the overlap? In the end I indeed just would like to obtain a kind of loop of a stationary sound signal that is derived from a frequency spectrum, which comes from a instationary but linear speed runup in the first place. Therefore, Tim's reply made me think about the following way to do it: Use the FFT-Spectrum of the relevant block as a filter for white noise in circular convolution: 1. Generate a white noise time signal of desired length 2. Use the the spectrum of the revelant block as a filter in an overl-app procedure Do you think this approach could work? (before I start implementing, just would like to estimate whether it is worth giving the try) Thank and best regards! _____________________________ Posted through www.DSPRelated.com
On Tue, 21 Jan 2014 02:21:18 -0600, Cranisch wrote:

>>On Mon, 20 Jan 2014 05:37:35 -0600, "Cranisch" <99289@dsprelated> wrote: >> >>>Ok guys, i am a mechanical engineer...so please forgive me if i get > messed >>>up with some DSP terms ;-) >>> >>>I have the following issue: >>>From a test bench measurement in a speed runup I have obtained an > air-borne >>>sound signal with a microphone (sampling rate 48kHz). I need to extract > a >>>stationary sound signal for one specific speed out of the "continuous" >>>speed runup. >>> >>>Therefore, i have tried the following procedure (MATLAB): >>>1. Performed a block-wise FFT with 8192 and without windowing or >>>overlapping 2. Identified the right block that represents my requested >>>speed 3. Applied an IFFT in order to get a time-signal for this block >>>(length 8192) >>>4. Copied the time-signal many times with a 50%-overlap in order to > build >>>up the desired length of the stationary signal >>> >>>Now what i get is a sound signal with the right frequency content but > with >>>some odd "artifacts". That means, when I listen to the result file I > hear >>>periodic "bumps". The periodity of the bumps correlate with the FFT >>>size and the overlap. When I use a significant larger FFT size of 32768 >>>the bumps occure more seldom and the intensity is reduced a little bit. >>>But I can not select a very large FFT size because of the averaging > effect >>>of frequencies due to the fact that the original signal comes from a >>>continuous speed runup. >>> >>>So, I need your help: >>>Do I use the right method for my task? >>>What can be done to avoid these artifacts? >>>Is there an easier way to synthesize such a signal? >>> >>>Thanks in advance! >>>Christian >>> >>> >>> >>>_____________________________ >>>Posted through www.DSPRelated.com >> >>There will be discontinuities between the ends of the files, so an easy >>thing to do is taper the ends (perhaps with a window like a raised >>cosine). If you taper the ends and then adjust the overlap so that the >>sum of the overlapped tapers is always 100%, it goes a long way toward >>masking some of the artifacts. This won't eliminate the basic >>periodicity, but it should help. >> >>Sometimes the length of the tapered part can be short, e.g., for an 8k >>block taper 100 points on each end, then overlap by 50 (assuming the >>taper is at 50% in the middle of the region). >> >> >>Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com >> >> > Ok, thank you very much for your fast replying. > Do that's what I understood so far: > 1. I should apply a window on to the blocks before transforming into > frequency domain 2. Identify my relevant (speed) block 3. IFFT that > block and overlap several of these blocks in a tapered way (e.g. a > windowed like raised cosine - is there any standard window doing that? i > saw the Planck-taper and the Tukey window on wikipedia) > > Did I get you right? Don't I need the same window for the 1st step (FFT) > or should it be sufficient only for the overlap? > > > In the end I indeed just would like to obtain a kind of loop of a > stationary sound signal that is derived from a frequency spectrum, which > comes from a instationary but linear speed runup in the first place. > > Therefore, Tim's reply made me think about the following way to do it: > Use the FFT-Spectrum of the relevant block as a filter for white noise > in circular convolution: > 1. Generate a white noise time signal of desired length 2. Use the the > spectrum of the revelant block as a filter in an overl-app procedure > > Do you think this approach could work? (before I start implementing, > just would like to estimate whether it is worth giving the try)
I would enthusiastically endorse the filtered white noise idea, except for one thing: engine sounds are periodic at root, and you'll lose that with the white noise. You'll end up with "engine-ish noise". Whether it's _good_ enough engine-ish white noise is more than I know. I suspect that you'll just have to give it a whirl and see. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
>On Tue, 21 Jan 2014 02:21:18 -0600, Cranisch wrote: > >>>On Mon, 20 Jan 2014 05:37:35 -0600, "Cranisch" <99289@dsprelated>
wrote:
>>> >>>>Ok guys, i am a mechanical engineer...so please forgive me if i get >> messed >>>>up with some DSP terms ;-) >>>> >>>>I have the following issue: >>>>From a test bench measurement in a speed runup I have obtained an >> air-borne >>>>sound signal with a microphone (sampling rate 48kHz). I need to
extract
>> a >>>>stationary sound signal for one specific speed out of the "continuous" >>>>speed runup. >>>> >>>>Therefore, i have tried the following procedure (MATLAB): >>>>1. Performed a block-wise FFT with 8192 and without windowing or >>>>overlapping 2. Identified the right block that represents my requested >>>>speed 3. Applied an IFFT in order to get a time-signal for this block >>>>(length 8192) >>>>4. Copied the time-signal many times with a 50%-overlap in order to >> build >>>>up the desired length of the stationary signal >>>> >>>>Now what i get is a sound signal with the right frequency content but >> with >>>>some odd "artifacts". That means, when I listen to the result file I >> hear >>>>periodic "bumps". The periodity of the bumps correlate with the FFT >>>>size and the overlap. When I use a significant larger FFT size of
32768
>>>>the bumps occure more seldom and the intensity is reduced a little
bit.
>>>>But I can not select a very large FFT size because of the averaging >> effect >>>>of frequencies due to the fact that the original signal comes from a >>>>continuous speed runup. >>>> >>>>So, I need your help: >>>>Do I use the right method for my task? >>>>What can be done to avoid these artifacts? >>>>Is there an easier way to synthesize such a signal? >>>> >>>>Thanks in advance! >>>>Christian >>>> >>>> >>>> >>>>_____________________________ >>>>Posted through www.DSPRelated.com >>> >>>There will be discontinuities between the ends of the files, so an easy >>>thing to do is taper the ends (perhaps with a window like a raised >>>cosine). If you taper the ends and then adjust the overlap so that
the
>>>sum of the overlapped tapers is always 100%, it goes a long way toward >>>masking some of the artifacts. This won't eliminate the basic >>>periodicity, but it should help. >>> >>>Sometimes the length of the tapered part can be short, e.g., for an 8k >>>block taper 100 points on each end, then overlap by 50 (assuming the >>>taper is at 50% in the middle of the region). >>> >>> >>>Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com >>> >>> >> Ok, thank you very much for your fast replying. >> Do that's what I understood so far: >> 1. I should apply a window on to the blocks before transforming into >> frequency domain 2. Identify my relevant (speed) block 3. IFFT that >> block and overlap several of these blocks in a tapered way (e.g. a >> windowed like raised cosine - is there any standard window doing that?
i
>> saw the Planck-taper and the Tukey window on wikipedia) >> >> Did I get you right? Don't I need the same window for the 1st step
(FFT)
>> or should it be sufficient only for the overlap? >> >> >> In the end I indeed just would like to obtain a kind of loop of a >> stationary sound signal that is derived from a frequency spectrum,
which
>> comes from a instationary but linear speed runup in the first place. >> >> Therefore, Tim's reply made me think about the following way to do it: >> Use the FFT-Spectrum of the relevant block as a filter for white noise >> in circular convolution: >> 1. Generate a white noise time signal of desired length 2. Use the the >> spectrum of the revelant block as a filter in an overl-app procedure >> >> Do you think this approach could work? (before I start implementing, >> just would like to estimate whether it is worth giving the try) > >I would enthusiastically endorse the filtered white noise idea, except >for one thing: engine sounds are periodic at root, and you'll lose that >with the white noise. You'll end up with "engine-ish noise". > >Whether it's _good_ enough engine-ish white noise is more than I know. I
>suspect that you'll just have to give it a whirl and see. > >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com > >
Ok, actually its not an engine sound measurement but a gearbox test rig, but anyways it is an power train ;-) So, that is what I did so far: First I tried the raised cosine window approach (I have chosen the Tukey-window, because of its nice implementation in MATLAB) and conducted an overlap-add procedure with different overlap factors and thus tapering factors of the Tukey-window. Thereby a varied also the NFFT size. I found a quite satisfying configuration with a reasonable big FFT-size of 65536 and 1% overlap (see attached files in the download). But I mentioned already, I'd rather go for a reduced FFT size, since a bigger one lead to more averaging effects of my tonal noise components and that is something I would like to avoid. Therefore, I reduced the FFT size to 32768 and 16384 (which you'll find also in the download) and the "bumping" or modulation increases to a level that is perceivable when you concentrate on analysing the sound file. That is where I decided to try the white noise filtering approach. Thereby, I generated a random noise vector of the required length and used the Tukey-windowed spectrum of my desired "speed"-block as a filter in an overlap-add procedure with the same Tukey-overlapping like before (see the [...]WNOLA[...] file). In the first place this approach worked better than expected. But due to the random input character the ouput looses noticeable volume and some level, although I normalized it to my orinigal frequency spectrum. I guess I will go ahead with the first approach and see what I can do to the remaining bumps. But please give me any comments you have on my observations. Thanks and regards! https://gigamove.rz.rwth-aachen.de/d/id/65qiqjrMwcTYY8 _____________________________ Posted through www.DSPRelated.com