DSPRelated.com
Forums

sideeffects of

Started by onep September 24, 2010
Hi,

I'm not really into DSP. I'm interested in this topic, but I'm lacking a
lot of necessary basic knowledge. However, I'm trying to process an
audiosignal and receiving some unwanted sideffects, which I would like to
get rid of. So I would be glad for any hints, which things I need to
consider.

Here's what I'm doing:
First I analyze an audiosignal A with an FFT (and then smooth the spectrum
with a so called "cepstral method"). Doing this with a continuous
audiosignal I receive a number of overlapping spectra (since I'm using a
overlapping Hamming Window performing the FFT).
Then I compare each smoothed spectrum with the following spectrum (of the
next window) by an algorithm (similar to optical flow for motion detection
in video processing) and receive vectors for each frequency bin, telling me
either that a frequency bin "seemed" to have moved up or down in
frequency.
These data of frequency movements I write into a file.
Then I try to use this data from the file to manipulate another soundfile -
an sudiosignal B.

I apply an FFT to audiosignal B and then move the frequency bins according
to the frequency shifts calculated from audiosignal A. E.g. according to my
file frequency bin 5 should move up 3 frequency bins (on a linear scale).
Then I would take the amount in frequency bin 5 and write it into frequency
bin 8 and afterwards set frequency bin 5 to 0.
Afterwards I interpolate the zero-values by simply averaging them with
their neighbour values.

So far so good, but if I continuesly (and repeatedly) apply frequency
shifting data of a long durated signal A to a short signal B, it starts to
produce click sounds and very strong peaks in the beginning and at the end
of each time domain signal of the frequency shifted material.

So, I wonder what could be the major reasons for this. I understand that a
strong amplitude difference in the time domain signal produces click-like
sounds, but how about a spectrum? Do rapid value differences between
neigboured frequency bins have a similar effect? And if, would there be any
kind of smoothing possible to avoid the peaks in the resulting time domain
signal?
Or might this be an issue which is more related because of messing with the
phase?

I know that this whole thing probably sounds like complete nonsense to most
of you, but I really would like it to work and would appreciate any
suggestions, which could help.

thanks a lot in advance,

Peter K.


What is the purpose of this? Tell what you try to accomplish instead of 
telling what you do.

VLV


onep wrote:
> Hi, > > I'm not really into DSP. I'm interested in this topic, but I'm lacking a > lot of necessary basic knowledge. However, I'm trying to process an > audiosignal and receiving some unwanted sideffects, which I would like to > get rid of. So I would be glad for any hints, which things I need to > consider. > > Here's what I'm doing: > First I analyze an audiosignal A with an FFT (and then smooth the spectrum > with a so called "cepstral method"). Doing this with a continuous > audiosignal I receive a number of overlapping spectra (since I'm using a > overlapping Hamming Window performing the FFT). > Then I compare each smoothed spectrum with the following spectrum (of the > next window) by an algorithm (similar to optical flow for motion detection > in video processing) and receive vectors for each frequency bin, telling me > either that a frequency bin "seemed" to have moved up or down in > frequency. > These data of frequency movements I write into a file. > Then I try to use this data from the file to manipulate another soundfile - > an sudiosignal B. > > I apply an FFT to audiosignal B and then move the frequency bins according > to the frequency shifts calculated from audiosignal A. E.g. according to my > file frequency bin 5 should move up 3 frequency bins (on a linear scale). > Then I would take the amount in frequency bin 5 and write it into frequency > bin 8 and afterwards set frequency bin 5 to 0. > Afterwards I interpolate the zero-values by simply averaging them with > their neighbour values. > > So far so good, but if I continuesly (and repeatedly) apply frequency > shifting data of a long durated signal A to a short signal B, it starts to > produce click sounds and very strong peaks in the beginning and at the end > of each time domain signal of the frequency shifted material. > > So, I wonder what could be the major reasons for this. I understand that a > strong amplitude difference in the time domain signal produces click-like > sounds, but how about a spectrum? Do rapid value differences between > neigboured frequency bins have a similar effect? And if, would there be any > kind of smoothing possible to avoid the peaks in the resulting time domain > signal? > Or might this be an issue which is more related because of messing with the > phase? > > I know that this whole thing probably sounds like complete nonsense to most > of you, but I really would like it to work and would appreciate any > suggestions, which could help. > > thanks a lot in advance, > > Peter K. > >
On 09/24/2010 08:17 AM, Vladimir Vassilevsky wrote:
> > What is the purpose of this? Tell what you try to accomplish instead of > telling what you do. > > VLV
Agreed. You have described a whole bunch of trees in loving detail, but you haven't told us where the forest is, yet. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
Well, that's probably the reason why I felt like explaining the details. It
might sound strange, but I basically want to do what I have described. The
overall project I'm working on is about exploring an algorithm, which is
the Lukas-Kanade Optical Flow algorithm. Regarding Video this algorithm can
be used to compare the movement of pixel groups over time. So I'm trying to
do sth similar with sound (well, as analog as it could get since video and
audio are obviously quite different things).

This is the purpose - technically, I want to apply repeatedly frequency
shifting to a soundfile. Frequency shifting in which I shift different bins
for different amounts, and this over and over. Maybe I could call it
Morphing without a final destination?

Sorry, if this all sounds confusing, maybe I should mention that I work in
a media art department of a University?


>On 09/24/2010 08:17 AM, Vladimir Vassilevsky wrote: >> >> What is the purpose of this? Tell what you try to accomplish instead of >> telling what you do. >> >> VLV > >Agreed. You have described a whole bunch of trees in loving detail, but >you haven't told us where the forest is, yet. > >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com > >Do you need to implement control loops in software? >"Applied Control Theory for Embedded Systems" was written for you. >See details at http://www.wescottdesign.com/actfes/actfes.html >
On Sep 25, 4:44&#4294967295;pm, "onep" <P@n_o_s_p_a_m.dimmsumm.com> wrote:

> > Sorry, if this all sounds confusing, maybe I should mention that I work in > a media art department of a University? >
Why didn't you tell them earlier so they could have ignored you more quickly. Hardy
@Hardy
well, I admit that I was suprised that I couldn't find any of those
comments for the pure sake of commenting. At least not in the threads I
read so far of this forum... seems I should have checked better. 
thanks

>On Sep 25, 4:44=A0pm, "onep" <P@n_o_s_p_a_m.dimmsumm.com> wrote: > >> >> Sorry, if this all sounds confusing, maybe I should mention that I work
i=
>n >> a media art department of a University? >> > >Why didn't you tell them earlier so they could have ignored you more >quickly. > > >Hardy >

onep wrote:

> So, I wonder what could be the major reasons for this. I understand that a > strong amplitude difference in the time domain signal produces click-like > sounds, but how about a spectrum? Do rapid value differences between > neigboured frequency bins have a similar effect? And if, would there be any > kind of smoothing possible to avoid the peaks in the resulting time domain > signal? > Or might this be an issue which is more related because of messing with the > phase?
If you manipulate a result of FFT of a piece of a signal, and then convert it back to the time domain by means of IFFT, you will get the discontinuites at the edges of the block. The way to mitigate this effect is overlapping and adding the consequitive windowed FFT frames. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On 09/25/2010 01:39 AM, HardySpicer wrote:
> On Sep 25, 4:44 pm, "onep"<P@n_o_s_p_a_m.dimmsumm.com> wrote: > >> >> Sorry, if this all sounds confusing, maybe I should mention that I work in >> a media art department of a University? >> > > Why didn't you tell them earlier so they could have ignored you more > quickly.
Oooh, snarkity snark. Or maybe taken that into account and not beat up on him for not asking his prof, instead? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On 09/24/2010 09:44 PM, onep wrote:
(top posting fixed)
>> On 09/24/2010 08:17 AM, Vladimir Vassilevsky wrote: >>> >>> What is the purpose of this? Tell what you try to accomplish instead of >>> telling what you do. >>> >>> VLV >> >> Agreed. You have described a whole bunch of trees in loving detail, but >> you haven't told us where the forest is, yet. >>
> Well, that's probably the reason why I felt like explaining the > details. It > might sound strange, but I basically want to do what I have described. The > overall project I'm working on is about exploring an algorithm, which is > the Lukas-Kanade Optical Flow algorithm. Regarding Video this algorithm can > be used to compare the movement of pixel groups over time. So I'm trying to > do sth similar with sound (well, as analog as it could get since video and > audio are obviously quite different things). > > This is the purpose - technically, I want to apply repeatedly frequency > shifting to a soundfile. Frequency shifting in which I shift different bins > for different amounts, and this over and over. Maybe I could call it > Morphing without a final destination? > > Sorry, if this all sounds confusing, maybe I should mention that I work in > a media art department of a University? I'm not sure that you'd get any results that would be at all related to the original. The Fourier transform makes a heck of a lot of sense mathematically, but the relationship between sound and perception is considerably more complicated and subtle than just the bins in a Fourier transform. If you're just trying to take a sound file and make a complete mishmash of it, while still being able to say "the sounds that you are hearing are a computer-processed version of a recording of baby harp seals being clubbed to death with precious Stradivarius violins"*, then you may well be on the right track. If you are trying to _do_ something -- like preserve the meaning of a spoken or sung text, while completely changing the character either randomly or in some directed fashion -- then tell us what you _really_ want to do and someone will have a suggestion. * Engineers and scientists like to criticize artists for using public funds to generate absolute crap. Any time they start doing this in conversation, just bring up Cold Fusion or the Tacoma Narrows bridge or the number of gallons of oil it takes to make a gallon of biofuel -- that'll shut them up. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On Sep 27, 7:18&#4294967295;am, Tim Wescott <t...@seemywebsite.com> wrote:

> * Engineers and scientists like to criticize artists for using public > funds to generate absolute crap. &#4294967295;Any time they start doing this in > conversation, just bring up Cold Fusion or the Tacoma Narrows bridge or > the number of gallons of oil it takes to make a gallon of biofuel -- > that'll shut them up.
Who are 'they' you want to shut up? The artists? The engineers? Rune