Home Category Blog Audio Generator
Audio Generator PDF Print E-mail
Written by Antonio Alfinito   
Saturday, 16 February 2013 17:24

ARBITRARY AUDIO

GENERATOR

by i2mkm and i2tzk

 

 

 



This is a project by FoxDelta Project Team

 

The “Audio Generator” project implements a Digital Direct Synthesizer (DDS), a type of frequency synthesizer used for creating arbitrary waveforms from a single, fixed-frequency reference clock.

In its simplest form this particular circuit configuration can be implemented from a precision clock reference, an address counter, a programmable memory, and a D/A converter.


Please, for more detailed notes, refer to “A Technical Tutorial on Digital Signal Synthesis”, Analog Devices and to the very reach literature on this argument available from the net.

We choose a mid-range Microchip 18F4550 pic to implement the main blocks of the DDS process, f/w takes care to run a 32 bits architecture counter and to host the lookup table in his memory. A very tight loop reading and outputting the table values allows to generate very good signals from 10Hz up to 50KHz.

The address counter stores the current phase value of the generated waveform. The rate at which the register (phase accumulator) is updated and his increment determine the frequency of the output waveform. By setting the increment value to different values, we are able to produce different frequencies.

The current phase accumulator value is used to perform a lookup operation in the table to determine the next output value. The lookup table contains one cycle of the waveform to be generated, 256 sample points which represent the waveform.

Standard lookup tables are present for generate sine, sawtooth and square wave while a customizable table can be designed and uploaded to the pic memory by a pc program (Windows) specially written for this purpose.

Because to produce different frequencies from 10Hz to 50KHz at 1Hz step we are incrementing by more than one the phase accumulator (or in other word we are up-sampling or down-sampling the waveform stored in the lookup table) this results in missing samples. Hence some embedded jitter is present.

Only frequencies equal to the clock frequency divided by the waveform length and its sub multiples are not sampled and therefore they do not suffer from this problem.

Generally speaking, skipping some samples doesn’t represent a problem when generating a sine or similar waveform, the following filter stage absorbs most of this aliasing.

Waveform jitter is an issue generating an arbitrary function specially if the designed output is composed by a pulses burst. For this reason we decided to implement two algorithms processing the custom lookup table, obtaining a satisfactory work around to the jitter problem.

First algorithm CUSTOM_1 manages the sampling rate the same way as done for the standard tables: fixed clock and variable phase accumulator. The second one CUSTOM_2 is always full reading the table and different frequencies are obtained varying the sampling rate, this way the waveform is always drawn by 256 samples, no aliasing or jitter.

Of course, reading and outputting 256 samples whit a midrange pic device, implies some limitation to the max frequency generated but this guaranties the accuracy of the produced signal. Being the sampling rate 1uS, the max frequency is limited to a 256uS period.


To keep low the hardware cost, a ladder, made up of resistor pairs, makes the A/D converter, we recommend to select 1% tolerance resistors for these components.

A low-pass filter and a buffer amplifier bring the signal to the output connector.

Because we want also to output a square wave or a custom burst at digital TTL level, we added a Schimtt trigger stage to properly adjust the signal level.

Having a very flexible hardware design we decided to include in the “Arbitrary Audio Generator” project some additional functions useful for testing the Ham radio equipment.

  • A two tones generator has been implemented, two non-harmonically related sine waves of equal amplitude at 400Hz/2600Hz or 800Hz/1000Hz are generated.

  • noise generator producing WHITE and PINK noise. The “White Noise” generator implements the Linear Congruential Generator (LCG) algorithm. The “Pink Noise is generated by putting the white noise through a “pinking” filter which removes more energy as the frequency increases. The algorithm implemented applies to the white noise generator a weighted sum of first order filters to approximate a 10dB/decade filter (Paul Kellet's "economy" method).

  • AFSK tones. FSK signal is obtained switching between two continuously running oscillators at 2125Hz and 2295Hz, this method assure to maintain the phase coherency of each single tone allowing optimum decoding of weak signals.

 

AUDIO GENERATOR main features :

· Smart and very cheap hardware implementation

· Free firmware and software for the Ham Radio Community

· Generate standard sine, sawtooth and square wave from 10Hz to 50KHz

· Generate two tones for cat-eye SSB test

· Generate AFSK tones (2125/2295 Hz)

· Generate white and pink noise

· Generate arbitrary waveform

· Special PC program allows to design custom waveforms and upload the generator memory

 

Last Updated on Saturday, 16 February 2013 19:10