Re: Digital sine wave generation




Tim Shoppa wrote:
bill.sloman@xxxxxxxx wrote:
Tim Shoppa wrote:
OK, Bill, this is what I'm saying: to synthesize a sine wave with 16
steps, choose the values so that what comes out is sin(phase) for 16
equally spaced phases from 0 to 2pi...
[...]
And then tell me how what you do is better. Are your first 14 harmonics
zero? Or are you spreading out the badness so that some harmonics below
the 14th are nonzero, but such that your synth plus low-pass filter
combo is more effective at reducing THD in the end because your higher
harmonics have been chosen to be lower?

Good question. Since I was filtering psuedo-random noise back in 1977,
it is going to be difficult to answer this question. From what I can
recall, the truncated sinc sequence gave a sharper low frequency
cut-off (with some ringing) followed by a rather poor and oscillating
cut-off at higher freqencies, while the raised-cosine windowed sequence
did not cut off as sharply at low frequencies, but gave a pretty much
monotonically increasing cut-off with increasing frequency.

If you only want to synthesise a narrow range of sine wave frequencies,
the amplitude of the high frequency harmonics isn't too important - you
can always filter them out with a low pass filter.

Bill -

I've come to the conclusion that you are solving a different problem
(bandpass of a noisy signal) than the one I'm obsessed with
(synthesizing a sine wave where the clock is an exact multiple of the
output frequency).

Nothing against what you did, I'm sure it was interesting, and it is
related in an abstract way to what I'm doing (your parallel with FIR
filters has some relevance in a sort-of upside down way, because I'm
starting out with a digital clock that has no noise beyond jitter in
the 10-20 ns range).

But what I'm doing is hoplelessly more simplistic. JUST choosing
optimal E96 resistor values to give good approximations for sin(phase)
for equally spaced steps.

Right, but what you are doing is producing a staircase apprixiation to
a sine wave.

If you take the staircase that you are going to synthesise, and do a
Fourier analysis on it, you will find - as you intend - a large
component at 1/16th of your clock frequency, very small components at
the first few harmonics of that frequency - due to the tolerances on
your resistors, and the limitations of working within the E96 grid,
followed by quite large harmonics at the clock frequency and its
harmonics.

You cna understand this intuitively by subtracting your desired sine
wave from your staircase approximation, which leaves you with a series
of sawteeth, whose amplitude is at a maximum around 0 and 180 degrees,
and whose polarity reverses from 0 to 180 degrees.

At present you are tinker with the staircase to minimise the harmonics
below the clock frequency. You can equally tinker to minimise the
harmonics above the clock frequency.

If your clock frequency is stable and never gets changed, then a fancy
multipole filter is the better way of getting rid of the higner
harmonics,

Even better is to use an integrator to synthesise the sine wave as
series of straight lines of variable slope - though the amplitude then
depends on the value of your integrating capacitor, and you might need
a precision rectifier and feedback loop to get an absolutely stable
amplitude over temperature.

--
Bill Sloman, Nijmegen

.



Relevant Pages

  • Re: 50 Ohm Analog Output of FPGA
    ... will not be able to fully filter it out. ... Why can't an FPGA output a "perfect" sine wave? ... square wave at 10 MHz, you will have harmonics at 30 MHz, 50 MHz, etc ... much higher rates and interpolate or decimate. ...
    (comp.arch.fpga)
  • Re: 6SN7 Mu Follower Distortion Paper
    ... Not yet - I am at present struggling to get a twin T notch filter ... To measure individual harmonics at F between say 2kHz and 10kHz, ... Usually, if THD is low, IMD will also be low. ...
    (rec.audio.tubes)
  • Re: Twin T Notch Anomaly
    ... distortion harmonics by removing the fundamental. ... I have measured the notch response so I know ... None of us have a clue what your problems with your twin T filter ...
    (rec.audio.tubes)
  • Re: Fast Fourier Filtering of an Instruments Harmonics
    ... helped me to release a guitar tuner for the mac as freeware.... ... problem once again of having too many harmonics resonating to pick out ... What you have to do is vary the filter. ... A fourier transform is general a method of spectra identification. ...
    (sci.math)
  • Re: Why use an anti aliasing filter with an energy meter.?
    ... understanding is you only need an anti aliasing filter if you want to ... Neither criteria apply to an energy meter. ... information for other energy measurement devices you will see very similar ... so higher harmonics are not handled correctly. ...
    (comp.dsp)

Quantcast