Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

storing samples

Post any examples or modules that you want to share here

storing samples

Postby jto1 » Fri Nov 30, 2012 3:59 pm

Hi, could some one tell me is it posible to store samples in a array then
Compare them with samples from a wav sample or even a live stream?
jto1
 
Posts: 7
Joined: Fri Jul 27, 2007 9:58 am

Re: storing samples

Postby trogluddite » Fri Nov 30, 2012 5:55 pm

Certainly, yes.
The two components 'mem to float array' and 'float array to mem' let you translate between a standard float array and the raw wave data (a 'wav file for example); and the various flavours of 'mono to graph' let you grab a 'snapshot' of an incoming audio stream as a float array of sample values. They all use the same -1...+1 range for min/max audio level, so the values you get are directly comparable.
The 'load wave' and 'save wave' components also mean that it is easy to read and store the 'mem' data using standard wave files that are usable in other applications.
If you wanted to compare two long arrays of data like that, I'd suggest using a Ruby routine, but you could also do it by using an 'integer loop' to iterate over the arrays using "green" components. Ruby would also make it possible to use the 'frames' components to grab snapshots of the audio with much better timing accuracy - though the CPU load is pretty high if you want to grab frames more that a few times per second.
That all would work at a pretty low data rate, of course - fine for comparing two arrays of data "off-line". If you wanted to correlate a live audio stream with a 'template', you'd need to work using the DSP code or Assembler primitives in order to write a routine that was anything like fast enough. But that is really not an easy task, as there's no way so far to push array data into those modules in bulk - similar things have been done before, but only for relatively short arrays of a few dozen samples.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: storing samples

Postby jto1 » Sat Dec 01, 2012 6:19 am

Thanks for your advice trogluddite. I did look at the ruby module for this, I will play around with it and
see what i come up with. Thanks again
jto1
 
Posts: 7
Joined: Fri Jul 27, 2007 9:58 am


Return to User Examples

Who is online

Users browsing this forum: No registered users and 83 guests