Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform


Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | Is it possible to generate harmonic distortion analytically?

There are 51 messages in this thread.

You are currently looking at messages 0 to 10.


Is it possible to generate harmonic distortion analytically? - Les Cargill - 2010-03-06 22:06:00

(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.

--
Les Cargill
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Is it possible to generate harmonic distortion analytically? - Jerry Avins - 2010-03-07 00:36:00



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. Assuming that I do, the answer is "Of Course." To 
show that, operate on the samples with any non-linear function.

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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Is it possible to generate harmonic distortion analytically? - Les Cargill - 2010-03-07 05:37:00

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?

> Jerry

--
Les Cargill
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Is it possible to generate harmonic distortion analytically? - Rune Allnor - 2010-03-07 07:05:00

On 7 Mar, 11:37, Les Cargill <lcargil...@comcast.net> wrote:

> > 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?

You ask the wrong question: The problem is not how to
generate nonlinear effects - just about any operation
will do that. The problem is how *not* to generate
them; only linear operators or operations don't.

> Which particular nonlinear
> functions would specifically produce second, third or fifth
> order harmonic distortion?

That's a completely different question. You will have
to investigate a candidate function to find out how
it behaves.

Rune
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Is it possible to generate harmonic distortion analytically? - Richard Owlett - 2010-03-07 08:38:00

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}

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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Is it possible to generate harmonic distortion analytically? - Jerry Avins - 2010-03-07 11:04:00

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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Is it possible to generate harmonic distortion analytically? - Les Cargill - 2010-03-07 18:06:00

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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Is it possible to generate harmonic distortion analytically? - Les Cargill - 2010-03-07 18:09:00

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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Is it possible to generate harmonic distortion analytically? - Jerry Avins - 2010-03-07 18:59:00

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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Is it possible to generate harmonic distortion analytically? - robert bristow-johnson - 2010-03-08 00:01:00

On Mar 7, 6:06=A0pm, Les Cargill <lcargil...@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 mig=
ht
> >>>> 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 kno=
w
> >> 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),
> > =A0 =A0and add it to the value in bin q*n.
> > 3. perform IDFT (and NO, I don't know how to VALIDLY handle the
> > =A0 =A0fact that you have now increased the number of bins by the
> > =A0 =A0highest harmonic created ;/)
> > { above presumes that DFT/IDFT are in terms of +/- frequency
> > =A0 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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | 2 | 3 | 4 | 5 | 6 | next