Hi All, I'm new to DSP, but have spent considerable time in the past working with Fourier analysis, particularly in relation to high accuracy approximations to digital functions. I have a few questions related to how well my background knowledge transfers to DSP. ( In particular audio effects processing). As I understand it (but please correct me if I'm wrong), we take a digital signal, transform to the frequency domain, do whatever we want with it there, and transform back to the time domain. So I was wondering ... 1. Is the Gibbs phenomenon ever a factor? Presumably there would be times when the input signal is discontinuous (eg when a guitar string is first plucked). How are the oscillations arising from the approximation of such a signal handled? By filtering? Which leads to my next question ... 2. As well as getting rid of the high frequency oscillations associated with discontinuities, filtering would get rid of any high frequency oscillations from the original input signal. What is the audible effect of this? 3. How is the non-periodic nature of the input signal handled? By Chebyshev approximation? If so how is the irregular sample point spacing handled? Thanks in advance, Pete.
Beginner DSP questions
Started by ●March 22, 2004
Reply by ●March 22, 20042004-03-22
NTL News wrote:> Hi All, > > I'm new to DSP, but have spent considerable time in the past working with > Fourier analysis, particularly in relation to high accuracy approximations > to digital functions. I have a few questions related to how well my > background knowledge transfers to DSP. ( In particular audio effects > processing). > > As I understand it (but please correct me if I'm wrong), we take a digital > signal, transform to the frequency domain, do whatever we want with it > there, and transform back to the time domain. So I was wondering ... > > 1. Is the Gibbs phenomenon ever a factor? Presumably there would be times > when the input signal is discontinuous (eg when a guitar string is first > plucked). How are the oscillations arising from the approximation of such a > signal handled? By filtering? Which leads to my next question ... > > 2. As well as getting rid of the high frequency oscillations associated with > discontinuities, filtering would get rid of any high frequency oscillations > from the original input signal. What is the audible effect of this? > > 3. How is the non-periodic nature of the input signal handled? By Chebyshev > approximation? If so how is the irregular sample point spacing handled? > > Thanks in advance, > > Pete.Oy Vay! The interesting ones are always hardest! You come to this with some reasonable, but erroneous, suppositions. You wrote "please correct me if I'm wrong", so here goes. Most digital signal diddling, like analog signal diddling, is done in the time domain. Samples go in, others come out. There are some good tutorials available on the web. check out http://www.dspguru.com for a list of them. Note that in order to properly sample a signal, it must be bandlimited. For baseband signals such as audio, there must be no significant energy as high as half the sampling frequency. To reconstitute such a signal as analog audio, it must again be filtered to remove the sharp edges of the D-to-A process. The Gibbs phenomenon isn't an issue there. Of course FFTs and edge effects are important in DSP work, just not in the way you seem to imagine. Follow the links, read a bit, then ask more questions. What's your main interest with DSP? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●March 22, 20042004-03-22
Thanks for the help, looks like I have some reading to do ... In answer to your question, my main interest is in creating digital audio effects for musical instruments. I'm a mathematician and computer programmer by profession, but my hobby is playing and recording music, so I'm interested in combining all of these things. Thanks again for your help, I'll probably be back with more questions after I've done some reading, Pete. "Jerry Avins" <jya@ieee.org> wrote in message news:405efab4$0$3072$61fed72c@news.rcn.com...> NTL News wrote: > > > Hi All, > > > > I'm new to DSP, but have spent considerable time in the past workingwith> > Fourier analysis, particularly in relation to high accuracyapproximations> > to digital functions. I have a few questions related to how well my > > background knowledge transfers to DSP. ( In particular audio effects > > processing). > > > > As I understand it (but please correct me if I'm wrong), we take adigital> > signal, transform to the frequency domain, do whatever we want with it > > there, and transform back to the time domain. So I was wondering ... > > > > 1. Is the Gibbs phenomenon ever a factor? Presumably there would betimes> > when the input signal is discontinuous (eg when a guitar string is first > > plucked). How are the oscillations arising from the approximation ofsuch a> > signal handled? By filtering? Which leads to my next question ... > > > > 2. As well as getting rid of the high frequency oscillations associatedwith> > discontinuities, filtering would get rid of any high frequencyoscillations> > from the original input signal. What is the audible effect of this? > > > > 3. How is the non-periodic nature of the input signal handled? ByChebyshev> > approximation? If so how is the irregular sample point spacing handled? > > > > Thanks in advance, > > > > Pete. > > Oy Vay! The interesting ones are always hardest! You come to this with > some reasonable, but erroneous, suppositions. You wrote "please correct > me if I'm wrong", so here goes. > > Most digital signal diddling, like analog signal diddling, is done in > the time domain. Samples go in, others come out. There are some good > tutorials available on the web. check out http://www.dspguru.com for a > list of them. > > Note that in order to properly sample a signal, it must be bandlimited. > For baseband signals such as audio, there must be no significant energy > as high as half the sampling frequency. To reconstitute such a signal as > analog audio, it must again be filtered to remove the sharp edges of the > D-to-A process. The Gibbs phenomenon isn't an issue there. > > Of course FFTs and edge effects are important in DSP work, just not in > the way you seem to imagine. Follow the links, read a bit, then ask more > questions. What's your main interest with DSP? > > Jerry > -- > Engineering is the art of making what you want from things you can get. > ����������������������������������������������������������������������� >
Reply by ●March 22, 20042004-03-22
"NTL News" <m_stanleyuk@yahoo.co.uk> wrote in message news:wtC7c.400$Kn2.349@newsfe1-win...> Hi All, > > 3. How is the non-periodic nature of the input signal handled? By Chebyshev > approximation? If so how is the irregular sample point spacing handled?At least in audio, almost all sampling is regularly spaced (in time)*. This greatly simplifies the processing, hardware, etc.. Best wishes, audio DSP is a fun field! -Jon *This is not precisely true because of jitter in the sampling clocks, but this is generally small enough to be totally negligible. Of course, audiophiles are always trying to minimize jitter to improve quality. I just thought I'd mention this because you mentioned you are a mathematician.
Reply by ●March 22, 20042004-03-22
"NTL News" <m_stanleyuk@yahoo.co.uk> wrote in message news:wtC7c.400$Kn2.349@newsfe1-win...> Hi All, > > I'm new to DSP, but have spent considerable time in the past working with > Fourier analysis, particularly in relation to high accuracy approximations > to digital functions. I have a few questions related to how well my > background knowledge transfers to DSP. ( In particular audio effects > processing). > > As I understand it (but please correct me if I'm wrong), we take a digital > signal, transform to the frequency domain, do whatever we want with it > there, and transform back to the time domain. So I was wondering ... > > 1. Is the Gibbs phenomenon ever a factor? Presumably there would be times > when the input signal is discontinuous (eg when a guitar string is first > plucked). How are the oscillations arising from the approximation of sucha> signal handled? By filtering? Which leads to my next question ... > > 2. As well as getting rid of the high frequency oscillations associatedwith> discontinuities, filtering would get rid of any high frequencyoscillations> from the original input signal. What is the audible effect of this? > > 3. How is the non-periodic nature of the input signal handled? ByChebyshev> approximation? If so how is the irregular sample point spacing handled? >Pete, I will try to answer your questions rather directly: The Gibbs phenomenon is an issue if you are going to represent periodic signals with sharp discontinuities with a finite-length Fourier series. Depending on your applications, you may never do this. However, it is closely related to using the Discrete (or Fast version) Fourier Transform DFT/FFT because the frequency domain representation is discrete and periodic. So, it is "bandlimited". If a time function / signal is chopped out then its edges could well be sharp and the Gibbs phenomenon may be apparent. See Windowing - where the time function would be tapered at the edges to avoid this. As Jerry pointed out, you may never do any Fourier Transforms in what you're wanting to accomplish. In fact, it may be likely that you won't. But, if you do: You can't "do whatever you want" in the frequency domain any more than you can "do whatever you want" in the time domain. In general you can do only linear processes: filtering (multiplying), addition of signals, ..... if you expect to be able to analyze and get advice. Some other things can be done if treated properly but the discussion would be in the class of "advanced topics". Getting rid of high frequencies does just that. Play your hifi audio through only a woofer..... that's what you get in principle. But, it needn't be drastic in order to smooth sharp edges. Chebyshev? Irregular samples? I know what these terms mean but you're using them to imply some process you've not defined well enough for one to comment. Knowing more about what you want to do would be really helpful. Fred
Reply by ●March 23, 20042004-03-23
> > 3. How is the non-periodic nature of the input signal handled? ByChebyshev> > approximation? If so how is the irregular sample point spacing handled? > > At least in audio, almost all sampling is regularly spaced (in time)*.This> greatly simplifies the processing, hardware, etc..Sorry, by this I meant that Chebyshev approximation requires an irregularly spaced grid, which if used would be a problem since audio samples are generally regularly spaced.> > Best wishes, audio DSP is a fun field! >Thanks, I'm beginning to see that :)> -Jon > > *This is not precisely true because of jitter in the sampling clocks, butthis> is generally small enough to be totally negligible. Of course,audiophiles are> always trying to minimize jitter to improve quality. I just thought I'dmention> this because you mentioned you are a mathematician. >... perhaps something to worry about in the future ...
Reply by ●March 23, 20042004-03-23
Peter Crossley wrote: ...> Sorry, by this I meant that Chebyshev approximation requires an irregularly > spaced grid, which if used would be a problem since audio samples are > generally regularly spaced.Chebyshev approximation achieves equal departures from the desired curve. It's not the waveforms that are usually approximated, but the transfer functions (i.e., frequency responses). Time and frequency seem to be running together in your thinking. A little reading will clear it all up. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●March 23, 20042004-03-23
Hi Fred,> > Pete, > > I will try to answer your questions rather directly: > > The Gibbs phenomenon is an issue if you are going to represent periodic > signals with sharp discontinuities with a finite-length Fourier series. > Depending on your applications, you may never do this. However, it is > closely related to using the Discrete (or Fast version) Fourier Transform > DFT/FFT because the frequency domain representation is discrete and > periodic. So, it is "bandlimited".Yep, I'm very familiar with FT's, DFT's and FFT's, just not in the context of DSP. If a time function / signal is chopped> out then its edges could well be sharp and the Gibbs phenomenon may be > apparent. See Windowing - where the time function would be tapered at the > edges to avoid this.I'll look into that, thanks for the pointer.> As Jerry pointed out, you may never do any Fourier Transforms in whatyou're> wanting to accomplish. In fact, it may be likely that you won't.Ok, It's just that every tutorial I've seen on DSP begins with a discussion of Fourier series, which was why I assumed this would be a good place to start.> > But, if you do: You can't "do whatever you want" in the frequency domainany> more than you can "do whatever you want" in the time domain. In generalyou> can do only linear processes: filtering (multiplying), addition ofsignals,> ..... if you expect to be able to analyze and get advice. Some other > things can be done if treated properly but the discussion would be in the > class of "advanced topics". > > Getting rid of high frequencies does just that. Play your hifi audio > through only a woofer..... that's what you get in principle. But, it > needn't be drastic in order to smooth sharp edges. > > Chebyshev? Irregular samples? I know what these terms mean but you're > using them to imply some process you've not defined well enough for one to > comment.All I was getting at here was that if the input signal is non-periodic in time, and you wish to Fourier transform it, you are essentially introducing a discontinuity in your input data at the extreme left and right of your time domain. This could in turn result in the Gibbs phenomenon I was just wondering if people were using Chebyshev approximation to counteract this, since Chebyshev approximations do not require the input signal to be time periodic. However they do require that sample points are non equidistant in time, which would be a problem for audio sampling.> > Knowing more about what you want to do would be really helpful. >Well, mostly I'm interested in applying digital effects to Music, so for example plugging a musical instrument directly into a PC's sound card and performing distortion, chorus, pitch shifting, possibly amp simulation for electric guitars. Like I said, I started reading DSP tutorials to get some background knowledge and that seemed to point me towards Fourier transforms, Thanks, Pete.
Reply by ●March 23, 20042004-03-23
"Peter Crossley" <petecrossley@yahoo.co.uk> wrote in message news:tMY7c.980$Aa.613@newsfe2-gui.server.ntli.net...> > > > Chebyshev? Irregular samples? I know what these terms mean but you're > > using them to imply some process you've not defined well enough for oneto> > comment. > > All I was getting at here was that if the input signal is non-periodic in > time, and you wish to Fourier transform it, you are essentiallyintroducing> a discontinuity in your input data at the extreme left and right of your > time domain. This could in turn result in the Gibbs phenomenon I was just > wondering if people were using Chebyshev approximation to counteract this, > since Chebyshev approximations do not require the input signal to be time > periodic. However they do require that sample points are non equidistantin> time, which would be a problem for audio sampling. >Pete, Let's deal with Chebyshev approximations first. I don't believe this is common practice in this context. This is because Chebyshev approximation's objective is to yield a continuous function. And, that may be a polynomial based on samples at irregular intervals. However, what that has to do with Fourier Transforms is unclear to me. Not that one couldn't take the FT of such a function but that the sample points used to reach the function would no longer be the focus. Having reached any bandlimited continuous function, sampling it anywhere appropriate, including regularly, should not be a problem. How it gets to be bandlimited is a question though.... So, one could FT the continuous function or one could DFT a regularly sampled version of it - if suitably bandlimited before sampling. As before, the Gibbs phenomenon in time is the result of truncating its corresponding discrete Fourier Transform, or, Fourier Series. The Gibbs phenomenon in frequency is the result of truncating its sampled time series. It's probably the former you're concerned about. So, yes, if you truncate a time series so that it appears to be a periodic waveform with a sharp discontinuity, then you might see some Gibbs phenomenon at the discontinuity. It's a sure sign that the signal was not bandlimited to begin with - because truncating the Fourier Series made a difference! In a properly sampled signal, the Fourier Series components will be limited to be < fs/2. Actually, if you move back a bit and consider the original continuous time function and take a chunk of it and use that as a single period of a periodic waveform before sampling - rather than sampling first and taking a chunk of it next - then you'll see more readily that the sampling criterion can't be met because of the infinite bandwidth of the discontinuity. It's much easier to envision this way. Either way, the resulting samples would be the same. So, what you want to do conceptually is lowpass the chunked/periodic waveform *before* sampling. This amounts to smoothing that sharp transition. Once that's done, then you can sample it. You can't sample first and filter second because frequency aliasing occurs with the sampling if the filtering hasn't been done. I think this discussion is only pertinent to a situation where you are going to chunk the data, take a Fourier Transform, perform some operation in the frequency domain and then return to the time domain (in chunks). There must be methods for doing it in a way that deals with the discontinuities introduced by chunking - but I'm not too well versed in how that might be done for music. That said, here is one way it's done: Take a chunk and process it. The end edges will result in "transients" that are unwanted. This is sort of the same issue as the Gibbs phenomenon - but different. If the "system" that is processing the chunk has a longer appreciable impulse response than the length of the chunk, then *all* of the output will be a transient. (Thus, the system has to have an impulse response length somewhat short compared to the temporal length of the data). Next take an overlapping chunk and process it. Throw away the edge parts and join adjacent samples of the two chunks at the output. Look up: "overlap save" for how it's done. Jerry's suggestion that many things be done on a streaming basis in the time domain avoids all the chunking stuff. So, that's very worthy of consideration. Fred
Reply by ●March 24, 20042004-03-24
Peter Crossley wrote: (snip)> Ok, It's just that every tutorial I've seen on DSP begins with a discussion > of Fourier series, which was why I assumed this would be a good place to > start.Some might disagree with me, but I believe that the Fourier transform (and Fourier series) are an important part of DSP, even if you never actually do them. Just to be able to think in the time and frequency domain is important sometimes. (snip)> All I was getting at here was that if the input signal is non-periodic in > time, and you wish to Fourier transform it, you are essentially introducing > a discontinuity in your input data at the extreme left and right of your > time domain.To me, if you have a finite time signal, which you usually do, considering it periodic with a period equal to (or greater than) its length makes some sense. For sufficiently long signals, there aren't many side effects. (My favorite example is my CD player which always goes back to track 1 when it gets to the end. I think that is usual for car CD players. It seems to agree that the signal is periodic.) (snip)> Well, mostly I'm interested in applying digital effects to Music, so for > example plugging a musical instrument directly into a PC's sound card and > performing distortion, chorus, pitch shifting, possibly amp simulation for > electric guitars. Like I said, I started reading DSP tutorials to get some > background knowledge and that seemed to point me towards Fourier transforms,Mostly Fourier transforms aren't used because they can't be used on real time signals, and aren't very practical for many signals. Has anyone ever done an FFT on a whole CD? It might not take so long to do. Though in audio and video compression short cosine transforms are used. -- glen






