Show Posts
Pages: [1] 2 3 ... 7
1  Using Arduino / Audio / Re: arduino FHT on: April 11, 2014, 11:08:50 pm
using the above method (sequential sampling of ADCs) will give the same sample rate, and 1/3 the update rate (as compared to doing a single ADC).  so the frequency resolution will be the same as if you did only 1 ADC, but you only get that information every 3rd time.
2  Using Arduino / Audio / Re: arduino FHT on: April 10, 2014, 09:33:41 pm
the rate at which it samples is set by ADCSRA.  with ADCSRA = 0xf5 the sample rate is 38ksps, ADCSRA = 0xf6 gives 19ksps, and ADCSRA = 0xf7 gives 9.5ksps.  to go to lower sample rates you will need to setup a timer to trigger the ADC.  using delays is not reccomended as it isnt consistent, although that may not matter too much for your application.  be sure to uncomment the cli() if you want to use delay().
3  Using Arduino / Audio / Re: arduino FHT on: April 10, 2014, 08:38:52 am
you need to switch between the various ADC inputs in the loop().  also, you should turn off all DIDR0 that you will be using.  if you are sampling 3 ADCs, you can either interleave them, which gives you 1/3rd the sample rate, or you can do them sequentially, which gives you the full sample rate.  the example below shows the latter.  the advantage to doing it this way, is that you dont run out of memory.

Code:
#define LOG_OUT 1 // use the log output function
#define FHT_N 256 // set to 256 point fht

#include <FHT.h> // include the library

void setup() {
  Serial.begin(115200); // use the serial port
  TIMSK0 = 0; // turn off timer0 for lower jitter
  ADCSRA = 0xe5; // set the adc to free running mode
  ADMUX = 0x40; // use adc0
  DIDR0 = 0x07; // turn off the digital input for adc0,1,2
}

void loop() {
  for (byte n = 0; n < 3; n++) { // go through the first 3 ADCs
    ADMUX = 0x40 | n; // set mux to the current ADC
    cli();  // UDRE interrupt slows this way down on arduino1.0
    for (int i = 0 ; i < FHT_N ; i++) { // save 256 samples
      while(!(ADCSRA & 0x10)); // wait for adc to be ready
      ADCSRA = 0xf5; // restart adc
      byte m = ADCL; // fetch adc data
      byte j = ADCH;
      int k = (j << 8) | m; // form into an int
      k -= 0x0200; // form into a signed int
      k <<= 6; // form into a 16b signed int
      fht_input[i] = k; // put real data into bins
    }
    fht_window(); // window the data for better frequency response
    fht_reorder(); // reorder the data before doing the fht
    fht_run(); // process the data in the fht
    fht_mag_log(); // take the output of the fht
    sei();
    Serial.write(255); // send a start byte
    Serial.write(fht_log_out, FHT_N/2); // send out the data
  }
}
4  Using Arduino / Project Guidance / Re: digital low-pass filtering and fft for accelerometer data on: February 09, 2014, 01:49:57 pm
the output is in binary, not ascii characters, which is why it looks like gibberish.  you can change serial.write to serial.print and it should be readable, although you might have to go through and output each number, one at a time, rather than the batch operation shown.

you should also take a look at the equations for calculating the number of bands, band width, and sampling rate.

finally, the FHT on that site is a lower overhead program that does the same thing
5  Community / Products and Services / Arduino compatible audio DSP platform on: November 19, 2013, 06:12:47 pm
we are selling out the last of our MICrODEC's at below cost.  it is an arduino compatible (atmega3250p) platform for doing audio processing.  it has a stereo, 16b, 44ksps codec, and 6 seconds of sample memory.  there is also a case, while they last.

http://www.openmusiclabs.com/store1/microdec-store/

some soldering is required, and you will also need an FTDI cable to program it.  there is a very basic library written for it, but it is geared more at advanced arduino users.  we have a few of these left in stock, and are looking to get them out to good homes.
6  Using Arduino / Audio / Re: Arduino Realtime Audio Processing on: October 28, 2013, 03:50:43 pm
that sounds pretty good.  if you want a reference design for aliasing filters, here is one that works pretty well.
http://wiki.openmusiclabs.com/wiki/StompShield

there is a sound sample on there as well, so you can see if it will be any improvement over what you have.
7  Using Arduino / Audio / Re: TL082 preamp: help please! on: October 26, 2013, 02:10:27 pm
RE: rail to rail - opamps are all a little different from one another, and none of the behave exactly like an "ideal" opamp.  and there are a number of different ways in which they stray from this "ideal" behaviour.  one of these has to do with how close a signal can get to the powersupply, both for signals being applied to the input pins, and the signal coming out of the output.  the TL082 is pretty bad about this, it can only get within ~3V of the output rail, on both the bottom and top rail.  The LM358 is better, it can accept inputs all the way down to the bottom rail, and apply outputs all the way down to the bottom rail, but can only go as high as (Vcc - 2V) at the input and (Vcc - 1V) output.  so if you were to run it off 0V and 5V rails, you could only get an output swing of 0V to 4V.  so its almost rail-to-rail, but not quite.

i usually like to reccomend the TLV2372 for generic rail-to-rail circuits.  its a little more expensive, and not available at the corner electronics store, but acts more like an "ideal" opamp.  the MCP602 is a good opamp as well, but it can not accept inputs all the way to the positive rail.  the MCP6002 is also a good choice, as it is very inexpensive and has full rail-to-rail inputs and outputs (RRIO), but i only hesitate to reccomend them because they run off 6V max.  so if you want to do a 9V battery circuit at somepoint and not use a voltage regulator, it will fry the amplifier.  so i generally keep a stash of TL082's and TLV2372's, and use the latter when i need rail to rail.
8  Using Arduino / Audio / Re: TL082 preamp: help please! on: October 25, 2013, 01:48:11 pm
the lm358 isnt quite rail to rail, but will be close enough to get you started.  i would definitely reccomend starting from scratch with the lm358 and an inverting amplifier.  its good to understand what you have done, but you might find it easier to get there if you take smaller steps along the way.  if you look a the circuit for the AC inverting amplifier on this page

http://www.openmusiclabs.com/testpage/

you can just make R1, R3, and R4 10k, R2 100k, and C 1uF, and run everything off 5V.
9  Using Arduino / Audio / Re: TL082 preamp: help please! on: October 24, 2013, 05:31:24 pm
you shouldnt need an oscilloscope to make a preamp.  it helps, but is not neccessary.

do you have a drawing or picture of what you have currently built?  how are you making +/-6V from the 12V?

the only advantage of the inverting amplifier is that it is easier to bias / requires less components/
10  Using Arduino / Audio / Re: TL082 preamp: help please! on: October 16, 2013, 06:26:53 pm
biasing always confused me when i was first getting started.  im working on an online tool to help out with this:
http://www.openmusiclabs.com/testpage/

it may or may not work, making webpages is not really my thing.  actually, using computers must not be my thing, considering i can no longer view much of anything on this webiste since they updated it.

basically, you take 2 equal value resistors, and connect one to 5V, the other to ground, and the juncture between them goes to the positive input of your amplifier.  the TL082 needs about 3V of headroom, so the +Vcc pin (postive powersupply) wil need more than 8V, and the -Vee pin (negative power supply) will need at least -3V.  otherwise they make different opamps that can go all the way to the rails, so you can just use +5V and ground as your supplies.
11  Using Arduino / Audio / Re: Problem using op-amp in audio system on: September 29, 2013, 01:53:15 am
the ts922 is a rail-to-rail opamp, whereas the tl072 is not.  this means that the tl072 can not amplify signals that get too close to ground or the powersupply rail, either at the input or the output (which happens in this circuit).   the ts922 also has a higher max output current.
12  Using Arduino / Audio / Re: i want to record audio in real time to matlab just record by any program on: September 27, 2013, 01:58:08 pm
its been a decade since i last did this, but here are some matlab links that seem to be useful:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/253177
https://www.mathworks.com/products/daq/supported/sound-cards.html
13  Using Arduino / Audio / Re: Suggestions for Audio DSP? on: September 25, 2013, 01:14:24 pm
one other, completely different pathway, would be to get small computer and put a usb sound card on it that has the io you want.  a raspberry pi might get you most of the way there.
14  Using Arduino / Audio / Re: Suggestions for Audio DSP? on: September 25, 2013, 01:11:43 pm
i would also reccomend looking into devboards from the major manufacturers.  TI has some stuff, Analog has its sigmaDSP line which is pretty interesting.  it has a nice GUI for doing filters and such easily.  Freescale also inst bad.  if you want something quick, you might try looking into the old tonecore pedals from line6.  they have stereo in and out, and an onboard dsp and microcontroller.  otherwise you will have to roll your own.
15  Using Arduino / Audio / Re: Suggestions for Audio DSP? on: September 24, 2013, 02:22:53 pm
1. how many analog ins/outs do you want?  you mention mixing 32 channels, but im guessing those are digital channels.

2. what aspects do you want to control with the arduino versus do on the DSP processor?

3. what language do you want to use to program the DSP side of things?
Pages: [1] 2 3 ... 7