From: Jerry Avins on 7 Mar 2010 11:04 Les Cargill wrote: > Jerry Avins wrote: >> Les Cargill wrote: >>> (in PCM streams, of course) >>> >>> What is a good book or website which can expose techniques which might >>> be of use to do this? >>> >>> Thanks in advance. >> >> The question as I understand it is so simple that I believe I may not >> really understand it. > > That is one of the most beautiful heuristics of human communication, > stated in a very good sentence. I am sorry; I don't know enough to know > whether I asked the question properly. > >> Assuming that I do, the answer is "Of Course." To show that, operate >> on the samples with any non-linear function. >> > > Randomly, or with malice and forethought? Which particular nonlinear > functions would specifically produce second, third or fifth > order harmonic distortion? Given that one has chosen a function, I don't see how randomness enters in. (Unless it's someone else's signal that you're distorting in order to be mean, malice doesn't seem to be involved either.) To mosr listeners, even harmonics are objectionable. To generate only odd harmonics, the function must symmetric (and the signal have no DC.) One useful function is y = a*tanh(b*x), where a and b scale the function. I sometimes use it for "soft clipping". Jerry -- It matters little to a goat whether it be dedicated to God or consigned to Azazel. The critical turning was having been chosen to participate. �����������������������������������������������������������������������
From: Les Cargill on 7 Mar 2010 18:06 Richard Owlett wrote: > Les Cargill wrote: >> Jerry Avins wrote: >>> Les Cargill wrote: >>>> (in PCM streams, of course) >>>> >>>> What is a good book or website which can expose techniques which might >>>> be of use to do this? >>>> >>>> Thanks in advance. >>> >>> The question as I understand it is so simple that I believe I may not >>> really understand it. >> >> That is one of the most beautiful heuristics of human communication, >> stated in a very good sentence. I am sorry; I don't know enough to know >> whether I asked the question properly. > > He does do that well, doesn't he ;) > >> >>> Assuming that I do, the answer is "Of Course." To show that, operate >>> on the samples with any non-linear function. >>> >> >> Randomly, or with malice and forethought? Which particular nonlinear >> functions would specifically produce second, third or fifth >> order harmonic distortion? > > Not sure of your goal. > A simple minded brute force method that *think MAY* meet your criteria > _MIGHT_ be: > > 1. perform DFT > 2. for each harmonic "q", multiply the value in bin n by r(q,n), > and add it to the value in bin q*n. > 3. perform IDFT (and NO, I don't know how to VALIDLY handle the > fact that you have now increased the number of bins by the > highest harmonic created ;/) > { above presumes that DFT/IDFT are in terms of +/- frequency > rather than frequency/phase} > I'd actually thought this might be an answer, but wasn't sure. It seemed too obvious. > That would seem to meet your *SPECIFICATION* . > *_HOWEVER_* I've a gut feeling it may not meet your need. > > How would you phrase your need if you were operating purely in the > analog domain? > > HTH I am thinking about trying to investigate adding various kinds of well-known distortions to PCM streams. This partly as part of a recording hobby, partly to learn about them. -- Les Cargill
From: Les Cargill on 7 Mar 2010 18:09 Jerry Avins wrote: > Les Cargill wrote: >> Jerry Avins wrote: >>> Les Cargill wrote: >>>> (in PCM streams, of course) >>>> >>>> What is a good book or website which can expose techniques which might >>>> be of use to do this? >>>> >>>> Thanks in advance. >>> >>> The question as I understand it is so simple that I believe I may not >>> really understand it. >> >> That is one of the most beautiful heuristics of human communication, >> stated in a very good sentence. I am sorry; I don't know enough to know >> whether I asked the question properly. >> >>> Assuming that I do, the answer is "Of Course." To show that, operate >>> on the samples with any non-linear function. >>> >> >> Randomly, or with malice and forethought? Which particular nonlinear >> functions would specifically produce second, third or fifth >> order harmonic distortion? > > Given that one has chosen a function, I don't see how randomness enters > in. I meant "random" as an answer to the question "how do I choose a function?" > (Unless it's someone else's signal that you're distorting in order > to be mean, malice doesn't seem to be involved either.) To mosr > listeners, even harmonics are objectionable. To generate only odd > harmonics, the function must symmetric (and the signal have no DC.) One > useful function is y = a*tanh(b*x), where a and b scale the function. I > sometimes use it for "soft clipping". > > Jerry What I'd really like to find is a book that describes this in more general terms - assuming that such a work exists. - Les Cargill
From: Jerry Avins on 7 Mar 2010 18:59 Les Cargill wrote: > Jerry Avins wrote: >> Les Cargill wrote: >>> Jerry Avins wrote: >>>> Les Cargill wrote: >>>>> (in PCM streams, of course) >>>>> >>>>> What is a good book or website which can expose techniques which might >>>>> be of use to do this? >>>>> >>>>> Thanks in advance. >>>> >>>> The question as I understand it is so simple that I believe I may >>>> not really understand it. >>> >>> That is one of the most beautiful heuristics of human communication, >>> stated in a very good sentence. I am sorry; I don't know enough to know >>> whether I asked the question properly. >>> >>>> Assuming that I do, the answer is "Of Course." To show that, operate >>>> on the samples with any non-linear function. >>>> >>> >>> Randomly, or with malice and forethought? Which particular nonlinear >>> functions would specifically produce second, third or fifth >>> order harmonic distortion? >> >> Given that one has chosen a function, I don't see how randomness >> enters in. > > > I meant "random" as an answer to the question "how do I choose a function?" > >> (Unless it's someone else's signal that you're distorting in order to >> be mean, malice doesn't seem to be involved either.) To mosr >> listeners, even harmonics are objectionable. To generate only odd >> harmonics, the function must symmetric (and the signal have no DC.) >> One useful function is y = a*tanh(b*x), where a and b scale the >> function. I sometimes use it for "soft clipping". >> >> Jerry > > What I'd really like to find is a book that describes this in more > general terms - assuming that such a work exists. I don't know of a comprehensive treatment. I don't like the sound of distortion, but I have built devices that deliberately distort in order to improve over-all utility. An amplitude compressor and speech clipper necessarily distorts, but can provide greater "punch" to radio transmissions. Distortion creates intermodulation. In digital circuits, it creates harmonics naively above fs/2, actually aliasing. The only way to avoid aliasing is using a sampling rate much higher than the original signal might seem to require. I think that working the problem through in your head once you decide what you want to do will get you where you want to go. Jerry -- It matters little to a goat whether it be dedicated to God or consigned to Azazel. The critical turning was having been chosen to participate. �����������������������������������������������������������������������
From: robert bristow-johnson on 8 Mar 2010 00:01
On Mar 7, 6:06 pm, Les Cargill <lcargil...(a)comcast.net> wrote: > Richard Owlett wrote: > > Les Cargill wrote: > >> Jerry Avins wrote: > >>> Les Cargill wrote: > >>>> (in PCM streams, of course) > > >>>> What is a good book or website which can expose techniques which might > >>>> be of use to do this? > > >>>> Thanks in advance. > > >>> The question as I understand it is so simple that I believe I may not > >>> really understand it. > > >> That is one of the most beautiful heuristics of human communication, > >> stated in a very good sentence. I am sorry; I don't know enough to know > >> whether I asked the question properly. > > > He does do that well, doesn't he ;) > > >>> Assuming that I do, the answer is "Of Course." To show that, operate > >>> on the samples with any non-linear function. > > >> Randomly, or with malice and forethought? Which particular nonlinear > >> functions would specifically produce second, third or fifth > >> order harmonic distortion? > > > Not sure of your goal. > > A simple minded brute force method that *think MAY* meet your criteria > > _MIGHT_ be: > > > 1. perform DFT > > 2. for each harmonic "q", multiply the value in bin n by r(q,n), > > and add it to the value in bin q*n. > > 3. perform IDFT (and NO, I don't know how to VALIDLY handle the > > fact that you have now increased the number of bins by the > > highest harmonic created ;/) > > { above presumes that DFT/IDFT are in terms of +/- frequency > > rather than frequency/phase} > > I'd actually thought this might be an answer, but wasn't sure. > It seemed too obvious. > > > That would seem to meet your *SPECIFICATION* . > > *_HOWEVER_* I've a gut feeling it may not meet your need. > > > How would you phrase your need if you were operating purely in the > > analog domain? > > I am thinking about trying to investigate adding various kinds of > well-known distortions to PCM streams. This partly as part of a > recording hobby, partly to learn about them. are you trying to introduce a specified amount of specific harmonics to a pure sine wave? if that is how you want to wrap the problem statement, then i would suggest you look into polynomials, and specifically Tchebyshev polynomials. but any general Nth-order polynomial will generate harmonics up to the Nth harmonic. r b-j |