Show Posts
Pages: [1] 2 3 ... 23
1  Products / Arduino Due / Re: Sampling frecuency of DAC on: July 03, 2014, 01:58:09 am
That code is only writing a value incoming from the serial port directly to the DAC.
 So i ask how are you controlling the frequency ?
how are the values being sent through the serial?
2  Products / Arduino Due / Re: How to set Sinewave with Frequency? on: July 03, 2014, 01:35:24 am
Above the Nyquist frequency. and starts aliasing. So, highest you can achieve should be :
Sampling_rate / 2 = Nyquist frequency
i.e. 44.100/2 =22.050 kHz
3  International / EspaƱol / Re: Mensajes de audio con Arduino, un sistema barato [INFO] on: November 16, 2013, 08:24:34 pm
Usa um RC low pass filter antes de lo altavoce, para limitar la maioria de los artifactos de lo PWM.
Se quiseras, hay postado algo sobre PCM and WAVE, de lo puento de vista de microcontroladores. Solo la introducion a elos... Mas para venir...
Quicas es util para vosotros..
*perdona mi espanol smiley
4  Using Arduino / Audio / Re: How to play Raw audio? on: November 16, 2013, 08:03:22 pm
No experience in streaming data online, but if you have the chance to choose the data format you have a few options...
WAVE PCM 8 bit is unsigned( probably the easiest and lighter to implement on a uC ( good for speech); 16 bit unsigned if you need more quality. Anything else might be a bit too much to handle in real time, specially if the sound is not the main aim of your project/code.
Or just PCM , given the chance, of course !
I started documenting the WAVE format from an embedded pont of view, as an option to an add-on for one of my projects.... Gives you a good insight into other related formats as well  AVI, RIFF and compression related ones, etc.
Hope it comes handy !
5  Using Arduino / Audio / Re: Can Arduino Be Set Up As an Audio Interface in Windows? on: November 16, 2013, 07:53:33 pm
Youd have a lot of problems ... Most audio standards are quite heavy on calculating and sample  if you wanted inputs), heavy on storage and the only lighter ones unbalance things by having compressed formats . You could always do everything on 8 bit unsigned PCM  16 bit is signed already and you dont want to get into IEEE Float format ): ).
Dedicated chips, deffo the way to go ! Unless you want to build a proof of concept. Then go for it !
There is a usb serial audio input with the DUE Forum post, somewhere ( was developed for an oscilloscope if my memory serves me well). But im gonna guess youd still have to deal with the PC processing of things in some way, plus deal with the encoding format youd be using.
As i said, id go for a dedicated chip, unless you want to study it , proof of concept or similar...
6  Using Arduino / Audio / Re: Adding ADSR to wavetable synth...? on: November 16, 2013, 07:44:56 pm
With the 8 bit series you can implement a linear, proper ADSR without many problems  rule of thumb, unless you already pushing it far); With DUE, you can take into the realms of looping inside the sustain stage, exponential attack stage, and a few more quirks not so easy with the 8 bit series, specially if you're aiming at a more complex synth module.
As Duane said , usually its done by one multiplication against a value based on an accumulator to keep track of where the ADSR is or whatever way you might find to do this).
Use the proverbial ADSR graph as a guide for a clearer understanding, if you havent already !

* Duane's posts are brilliant to guide you into the basic building blocks, plus saves you some hassle with the intricacies of the hardware.
I have been doing some posts on it, several different ideas, some of the classic methods, etc but not much of a finished working code posted as yet( just exemplifying, more on a reading style not optimized as was written for better understanding of the concepts i was trying to demonstrate in each of them; kind of building blocks stages, one by one).
I been trying to document as much as i can, so i can share it and hopefully help others save some time, where i didnt smiley
7  Using Arduino / Audio / Re: IIR Sine wave generation on: November 16, 2013, 07:32:11 pm
Nice one.... Been looking into all the discrete implementation methods for sines/cosines ( approximations inclusive) and hadn't looked properly into this method yet.
Thanks for sharing !
8  Using Arduino / Audio / Re: Arduino DDS Sinewave Generator on: November 16, 2013, 12:24:45 pm
If you dont need much accuracy, you can count time using many other methods... Interrupts being one of them ?! If not, there is always the option of a real time clock chip  ?! Or the proverbial 32.768 kHz crystal, to keep the time? I think it depends how accurate you need it to be !

PS: Actually, the interrupt on the code is quite close... Every 31250  Clock Interrupts, will be  a second, 15625 half a second, and each interrup 0.000032  of a second... A millisecond will be 31.250(31+1/4) and 125 will, make exactly 4 millis...
9  Using Arduino / Audio / Re: Arduino Realtime Audio Processing on: November 10, 2013, 09:00:35 am
Mike is probably right, as usual...
my guess would also go on...Maybe the wrong board/chip?!
As far as i remember that specific example will work on atmega 328, 168 and previous compatibles( 8, etc).
Even to use with the mega 2560 there might be the need for slight alterations in order to port the code( dont quote me on this, for this particular  example you mentioned though... Havent looked at the code for a while) , but am sure it does compile and work on the Uno/328,etc.
10  Using Arduino / Audio / Re: Arduino Realtime Audio Processing on: October 28, 2013, 03:35:24 pm
DC_Offset in this code is the Offset value used to make it a ONLY POSITIVE values for the pwm ( as its easier to work with this kind of signal calculations mimicking nature's laws ... ) As PWM will only work with values up to 255 the middle point is 127( a wave travels between +1 and -1 , with ZERO being the middle point). Does that make more sense ?! So DC_Offset is the value that offsets the result into a positive number( or zero), which is also the same as the value for the amplitude calculations( did you notice is also 127?! dc_offset +127= space wherethe wave will travel...its a cheap way of calculating it in the discrete domain ).
Hope it helps!
I tried to break down some of the techniques here. Hope it helps complement it a bit !
11  Community / Exhibition / Gallery / Re: Problem : Write a decimal to Roman Numerals Converter on: October 28, 2013, 03:18:15 pm
I know ! I took it as an attempt to take the seriousness out of it !
would have been enough. I have a perverted sense of humour !  smiley-cool
Hence the mention, "despite working dont take the code too serious ! Im not the best coder when it comes to clean code, but i aint that bad either ! smiley-mr-green
12  Community / Exhibition / Gallery / Re: Problem : Write a decimal to Roman Numerals Converter on: October 28, 2013, 10:40:48 am
I know !! And how it jumps from one side to the other, when it could have been so much simpler !  smiley 
13  Community / Exhibition / Gallery / Problem : Write a decimal to Roman Numerals Converter on: October 27, 2013, 08:55:54 pm
Problem : Write a decimal to Roman Numerals Converter
I had kept my eye on this weekly programming contest for a while, but only now rushed in to apply with some code.
 And  im quite sure i was the first to apply with a working project ! At what cost ?!  smiley-roll-sweat Check the code for yourself !!  smiley-cool
It does work, and thats what matters !
To take away that seriousness associated with programming ! smiley
14  Using Arduino / Audio / Re: How to do a DDS synth on Due with multiple waves. on: October 22, 2013, 10:28:28 am
This might help !
With a good explanation of different methods and ways of implementing it.
15  Using Arduino / General Electronics / Re: Potentiometers in parallel: can I do it? on: October 21, 2013, 05:49:56 pm
I find this circuit simulator quite useful so, so ( oh so) often!!
Pages: [1] 2 3 ... 23