PDA

View Full Version : 1 KHz Sine Wave



Art
- 7th November 2013, 02:48
Hi Guys,
I was wanting some ideas on making the best 1kHz sine wave for audio test tone.
I know you would never get the best result out of any mcu source, and the faster the better,
but the test tone is for amplifier clipping test, not quality test.

The best I can come up with is the biggest resistor ladder that can possibly be afforded
with available ports on the chip for as many possible voltage levels.
Where the hardware and software is totally dedicated to producing the sine wave,
and nothing else.

There would be some points where you could set more than one IO port to feed
current via more than one resistor to improve resolution.
Are there any examples of this?
Cheers, Art.

Jerson
- 7th November 2013, 03:58
This will get you started

https://www.google.co.in/search?q=pic+dds&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&gws_rd=cr&ei=yg97UpKVCcTQiAfj7YCoBQ

Regards
Jerson

Charlie
- 7th November 2013, 13:19
Why not simply pick a PIC with a DAC?

Art
- 11th November 2013, 12:48
If there is a good on board DAC compatible with PBP, that would be fine :)
Can you suggest one?

I imagine al the caps in the diagram are to smooth out intermediate steps?
That's going a bit far for me.
The 1kHz sine wave is to hear audible clipping matching an amplifier to a source.
I think it does have to be of fair quality to begin with.
What we hear are the tops and bottoms cut off the sine wave,
which may not be as noticeable if it is squared off to begin with.

It's a pity a DTMF encoder can't be dumbed down to do single frequencies.

Charlie
- 11th November 2013, 15:37
Sometimes, when you are used to using a hammer, everything looks like a nail.

If that's all you need to do, a PIC might not be the best answer:
http://www.stufinnis.co.uk/oscillator.html
or http://www.discovercircuits.com/Andy/Twin-Toscillator.pdf
Far simpler than a 5-bit DAC and filter.

Art
- 12th November 2013, 09:22
Thanks, you are right, it does look like it will do the trick :)

shottootto
- 12th November 2013, 09:27
extract:

" Arduino Sine wave Generator using the direct digital synthesis Method

Here we describe how to generate sine waves with an Arduino board in a very accurate way. Almost no additional hardware is required. The frequency range reaches form zero to 16 KHz with a resolution of a millionth part of one Hertz! Distortions can be kept less than one percent on frequencies up to 3 KHz. This technique is not only useful for music and sound generation another range of application is test equipment or measurement instrumentation. Also in telecommunication the DDS Method is useful for instance in frequency of phase modulation (FSK PSK)."

http://education-tn.blogspot.com/2013/03/sine-wave-oscillator-solid-circuits.html

Art
- 12th November 2013, 11:27
Am I the only one who can't see the images on that page?

EDIT,, ok, maybe he has just deleted the early example pictures.

That's interesting, I also want to do a frequency counter where the input
is a buffered sine wave, and both for the same project!

It has undergone some transformation since I got it :)

http://img.photobucket.com/albums/v186/ArtArt/IMG_0915_zps0ffa1c3c.jpg

Art
- 25th November 2013, 08:17
Lol, it just increments/decrements the index for a lookup table that is a pre-generated sine wave
to send to PWM.

Archangel
- 25th November 2013, 09:10
Am I the only one who can't see the images on that page?

Must be, I can see pictures & tables & code, lucky link for me as I was wanting an example in C for a lookup table. Check your ADBLOCK & script blocker settings, maybe you're blocking the images from there. . . I would say it's a safe bet that radio was old when you were born, what is it?

Art
- 25th November 2013, 13:04
Yes, but when I'm dead, it's going to be newer than that :)
There is another box that ends up going under this, to interface with it,
but without any new chassis holes (i.e.. nothing that can't be reversed.

http://img.photobucket.com/albums/v186/ArtArt/Its_Back_zps4b7976fc.jpg

It's the most ambitious for me yet.
RF probe frequency counter to display the LO frequency minus the Intermediate frequency for
digital station display, and then later, feedback to turn the original dial with a low geared stepper motor.
It is difficult to introduce a new micro or PSU, into an AM radio.

Art
- 26th November 2013, 01:20
Your lookup table in C is the same as using a PBP array.

byte[36] of the static declared array is index 35.
The size you declared the array, you start counting from one like a Human,
but when you go to address it, it's back to programming, and you count from zero.

Art
- 29th December 2013, 09:58
Don't know what to say... Old tube radios have analogue components, and unstable oscillators :D
Will have to do the Huff Puff technique to stabilise it with analogue components.
This is not yet fit for a robot tuner.

Kinda got a rule about completing projects, and number of simultaneous projects!

http://www.youtube.com/watch?v=9Yv4jE_EqPw