Wavetable synthesis with AD9850 DDS

Sorry, I've posted this inside an old thread, but I figure it might get better response in it's own thread...

Can you create complex waveforms using the AD9850? For instance, if you have a set of wavetables on the arduino, can you get the chip to play those complex waveforms under the arduino's control (rather than just sine waves)? Or if that's not possible, can you manipulate the AD9850's sine waves to appear like complex waveforms?

Sorry if that's a stupid question, but I'm new to this, and it's something I'm stuck on.

Also if it can't make complex waveforms, is there another chip/signal generator/oscillator/etc that can that I can control with an arduino?

Cheers in advance

Pete

Can you create complex waveforms using the AD9850?

No, sin waves only.

What frequency range do you need?

Bugger! Anyone know of any other chips or otherwise that i could control with the arduino to kick out complex waveforms? I was reading earlier about cirrus logic chips, the CS4742 in particular. What dyou think?

The simplest would be to use the arduino and an external A/D to send out samples. Then if you need more processing power use another arduino.

I can't see how a CS4247 will do what you want.

What is your application?

Wavetable synthesiser with a Mega2560, but I'm merging between the wave samples. Currently this is controlled by a pot on A0, and the location of the pot decides firstly: which two wave samples are being used, and secondly: what ratio of either sample is played (so the arduino does some maths to work this out). Currently I am outputting this though an 8bit r2r ladder DAC on port C.

The whole system is currently really slow and I can barely make it into the audio range. I am already working out how to reduce the encumbrance of the analogRead for the pot, and I am going to look through and see if I can use any smaller integer types to store the code (i'm assuming that will speed things up will it?). My last idea at the moment for better execution speeds is to just send the numbers I am generating from the wavetable mathmatics to something else that can worry about how to output it. Another arduino is a possibility I have considered, but it would be cool to find a chip or something similar that the arduino can control that will do a similar job.

I accept that I am quite new to this and so I may well be barking up the wrong tree here.

Thanks for your help!

Wavetable synthesiser with a Mega2560,

Look what I did with the humble 328 let alone a Mega:-

I'm merging between the wave samples.

Well this is the first you have said about this, it is important to give all relevant information if you want a decent answer.

so the arduino does some maths to work this out

That is where you are going wrong, getting a processor of this class to do maths between samples is just not gong to work. In my spoonduno these wave tables are precomputed and stored so all you have to do is to pick the correct part of the wave table to loop through. I have found that you get very good results with only 8 to 16 wavetables.
The wavetables are calculated in the Processing language and then downloaded to the Arduino which I fitted with an external EEPROM. This stores up to 32 sets of wave table. Then when I want to use one I transfer it to some external SRAM and read out the samples from that.

Currently I am outputting this though an 8bit r2r ladder DAC on port C.

You will struggle to make a good 8bit R2R ladder with fixed resistors even if they are 1%. Did you measure a batch of them and select the ones that were within 0.3% of each other? My spoonduno uses an external 12 but D/A.

Nice video man! That's a pretty groovy machine :smiley:

That is where you are going wrong, getting a processor of this class to do maths between samples is just not gong to work. In my spoonduno these wave tables are precomputed and stored so all you have to do is to pick the correct part of the wave table to loop through. I have found that you get very good results with only 8 to 16 wavetables.

Not sure if 8 to 16 fixed waves with no mixing between them would quite work for my project (though that's not to say I won't try it). Want a fairly seemless blend between them as i turn an encoder/pot. So maybe what you said about another microcontroller might be the key? Have one to store the wavetables, read the encoder and do the maths... and send the numbers to a second one that will output the resulting numbers. Could a connection between them be quick enough to keep up with this sample by sample? or is this when I would want to start thinking about buffer length and things like that? Maybe one microprocessor could calculate the entire wave array and pass that info over rather than work it out sample by sample?

You will struggle to make a good 8bit R2R ladder with fixed resistors even if they are 1%. Did you measure a batch of them and select the ones that were within 0.3% of each other? My spoonduno uses an external 12 but D/A.

Haha, I've done nothing of the sort, infact my R and 2R don't even entirely match up (oops!). I was meaning to ask someone if 330 and 680 would be close enough to work as it's the closest I have to R and 2R (not enough of one type of resistor to hand to double up for the 2R either).

So how does your external 12 bit DAC work? does the arduino give it numbers over serial or something similar, and the dac sorts out the rest? or is it connected to 12pins similar to my DAC? If it is the former, does this save the arduino time?

Cheers for your help thus far,

Pete

Could a connection between them be quick enough to keep up with this sample by sample?

No way.

Not sure if 8 to 16 fixed waves with no mixing between them would quite work for my project

Then why stop at that? You can have as many wave samples as you can fit in the external SRAM. I used a 23K256 chip and you can use as many as you want.

The D/A is a MCP4921 and you talk to it over the SPI bus, just like you do with the SRAM chip(s).

infact my R and 2R don't even entirely match up (oops!). I was meaning to ask someone if 330 and 680 would be close enough to work as it's the closest I have to R and 2R

No, the way you do it is to use all the same value of resistor and have two in series for the 2R resistor.

No, the way you do it is to use all the same value of resistor and have two in series for the 2R resistor.

I know, as I said, i didn't have enough of the same resistor at hand to do that.

Then why stop at that? You can have as many wave samples as you can fit in the external SRAM. I used a 23K256 chip and you can use as many as you want.

Ok, I like this idea. It would only take an evening to out a whole bunch of intermediate waveforms to plonk between my main ones and I'd have my desired result. So if I get an external DAC aswell, that will also free up some processor power will it?

I do then eventually want to expand this project into one that definately needs some maths done per sample. So if this isn't possible with an arduino, would this be more feasable with the leaflabs maple dyou think?

In fairness, the last question is for the future, gonna just stick with what i can achieve on the mega for the second untill i get more savvy with the whole affair.

would this be more feasable with the leaflabs maple dyou think?

Well an Arduino Due is in the same sort of class.

It would only take an evening to out a whole bunch of intermediate waveforms to plonk between my main ones and I’d have my desired result.

Well only a few seconds actually.

The way I programmed the spoondunio is to use an OSC program on my iPad and talk to it with processing. Then I used sliders to determine the envelope of each harmonic, the waveform was calculated on the fly.
See attached picture.

Huh, you're right. I hadn't noticed the clock speed on the Due before. And it has built in 12 bit DACs. I've missed a trick here! I should be on the Due not the Mega! Maybe I'll have to pick one of them up aswell.

Well only a few seconds actually.

The way I programmed the spoondunio is to use an OSC program on my iPad and talk to it with processing. Then I used sliders to determine the envelope of each harmonic, the waveform was calculated on the fly.
See attached picture.

Not sure this program would actually do what I need, but I can work out the intemediates easy enough.

Cheers for your help man

Pete