AD9833

Post and discuss new components that you have created.
mnfisher
Valued Contributor
Posts: 953
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

I'd be interested to see how the binaural beats 'machine' works - I tinkered with them many moons ago (using a program called NeuroProgrammer 2)

There's quite a bit more the chip can do - two frequencies can be programmed for PSK, GPSK and QPSK(?) - whatever they are - though I couldn't find a lot of info about them. It should be fairly easy to program the second frequency register.

How goes the TRS-80 re-animation?

Martin

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

The chips are certainly capable little things and one of their intended uses is in communications where we modulate a carrier (e.g. Phase Shift Keying). I probably wouldn't want to build a TDR using my particular modules though...:) I don't think the chip can output two simultaneous frequencies, just switch between them and change phase rapidly (as fast as you can write to a register). AD certainly like to hide their info and this is the best document I've came across for them so far after digging their site. This and the application note I mentioned previously should get people going:-

AD9833.pdf
(465.1 KiB) Downloaded 125 times

I bought a Binaural machine in the 90s that came with headphones and glasses fitted with LED lights. It had around thirty preprogrammed routines. Once volume / light levels were adjusted to comfortable levels off it went with great effect. I think it was called, or perhaps made by Halcyon. Unlike other machines this would alternate frequencies during the routine, not just play one set for the duration. Sort of "sweep" if you like. Programs were for all sorts of things such as creativity, de-stress and sleep. One sleep routine was called TKO (total knockout) and that lasted 45 minutes but I never got to the end of the routine as I'd be fast asleep long before program end. Until I used one I thought it was akin to modern day snake oil, but that machine changed my opinion, quite literally overnight.

Funny you should ask about the TRS-80 as I was going to post about it. I'll write something up soon.

Regards

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

A quick idea on binaural beats - which as far as understand are just created by having a slight 'difference' in frequency between left and right channels (played through headphones for best effect)
The above code was easy to modify to allow 2 (or indeed more) ad9833 chips to be connected to the same SPI channel (I don't think we need much horsepower here?) - and then frequency can be set by using SetFreq(channel, wave, frequency). This could easily be modified to have a SetFreq0 and a SetFreq1 (naming subject to revision) - though at the expense of some more code duplication.
I tested by setting pins d10 and d9 as FSYNC0 and FSYNC 1 (in properties) - and then setting two different frequencies to channel 0 and 1 in main. Will have to do a little more soldering to test with two chips - so just moved the jumper from d10 to d9 and watched the result on the oscilloscope.
Next - wire up the second breakout and connect to an amplifier / headphones ?
Binaural.fcfx
(18.85 KiB) Downloaded 121 times
Note this is pretty much the previous code - but in cal_spi I've set Use Auto CS to No and use the FSYNC pin properties to handle the relevant CS pin.

Martin

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

Thanks for that.

That slight difference is the apparent key to these machines and also the "carrier" for want of a badly chosen analogy. Much research / debate on the best carrier frequency too.

Basically your brain operates in one of four "states", alpha, beta, theta or delta corresponding to 7-13Hz, 13-40Hz, 4-7Hz and 0-4Hz respectively. For example a "carrier tone" is generated at say 500Hz for the right ear, and if you wanted to be in alpha state then the left ear would generate a tone at say 510Hz (or 490Hz for that matter). This difference of 10Hz is "heard" and used by the brain to enter whatever stage you wish (alpha in this example).

As mentioned much is claimed about the carrier tones used. Some say 500Hz is best, other go for an obvious 440Hz whilst others swear the best results are under 100Hz. Now I think on it, perhaps a suggestion might be to choose a carrier and go 50% of required Hz above/below? So for 10Hz using 500Hz, right would be 495Hz and left 505Hz

A few months back whilst toying with this I obtained a compact 3W+3W stereo amplifier from same source as the WFG's I got. No idea yet how much distortion this will create but at £3.99 fidelity is clearly assured...:)

Regards

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

Just tested with 2 x AD9833 and seems to work as above. Next step a small amp and some 'phones.

Wake me up when it's all over?
LabNation_Screenshot4.png
LabNation_Screenshot4.png (150.57 KiB) Viewed 2885 times
I should have soldered on the pins on opposite sides - then the two breakouts would sit nicely either side of a breadboard - with short jumpers across the 'gap'.

Martin

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Ha..!

You're not going to sleep...... you are too busy creating.

10Hz is right in the middle of Alpha, associated with creativity and look what you just came up with. If you do this just by me suggesting 10Hz just wait to you get your headphones :lol:

Regards

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

Tried the other module today.

I can see why people have problems and moan that "code doesn't work", but the reality is that if you buy cheap you are buying problems. I ran a little test around some jumpers so I knew they were good, my issue with these modules is with the supplied pins. These are too small to be reliably captured by the female jumper wires.

I replaced the header pins with stock from Farnel and now the module runs fine.

Regards

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

Sounds good - or rather it doesn't, I put the 500/510 Hz signal to stereo headphones, and could hear the 'beat'. Not sure it was inspiring though - think I'd use the term 'annoying'

I was driving the headphones directly from the ad9833 output - but I think the next job is a pot to adjust the frequency and a button to swap 'programmes'

Too nice to be inside today though must be 18C here and I'm out in the garden...

Martin

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

I've just got the second module running.

26C outside, add another five or so up in Ivory Tower... saving on electricity as I'm using a magnifying glass to solder with :)

Will not be in here for long.....

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

I found this

http://www.photosonix.com/

It's the company that made my device. Quite interesting reading and describes in general terms "beats".

Regards

Post Reply