PlainDSP (Part 1)

Part 1234

dsp

Among the most popular subjects covered in this blog, FFT is far ahead any other subject (22%!), followed by data acquisition functions. I got many, many requests for PlainFFT and PlainADC libraries and thanks to your explicit messages, I have a quite good understanding of who is using them and for which type of application. It is now clear to me that most of PlainFFT and PlainADC users have an average level in math and that they do not feel comfortable with advanced DSP functions. On the other hand, these advanced functions are extremely useful for building awesome applications, mainly in the field of arts, or should I say, interactive arts.

Based on this review, I decided to pack all the DSP functions that you like and need the most in a single, compact, fit for purpose library. The code has been optimized in order to simplify the use of the functions, e.g. unless you wish to do so, you do not have to care about vectors of data, you just use some nicknames such as DATA, REAL or IMAGINARY to name them, if you need to do so, do you?.  The PlainDSP performances have been optimized for speed, although it is not quick enough to allow real time processing. When run on an Arduino UNO, the data acquisition engine allows 0.125Hz to 80kHz sampling rates, and it does not take any longer than 75ms to acquire data and compute a 64 bins frequency spectra out of signal captured at a sampling rate of 44.1kHz. The maximum number of samples is limited to 128 when run on the Arduino UNO which includes 2kB; under these conditions, 1k is used for data storage. How come? 128 samples for real data, 128 samples for imaginary data, 4 bytes each samples (32 bits floats) = 2 x 128 x 4 = 1024 bytes. CQFD.

Here is a list of the public functions from the PlainDSP library:

Average();
ClearVector(dataType);
ComplexToReal(scaleType);
Compute(dir);
GetDataAddress(dataType);
GetScanData();
MajorPeak(*result);
MajorPeak(loFrequency, upFrequency, *result); 
Max(); 
Min(); 
Normalize(normalizingValue); 
ReadData(index);	
ReadData(dataType, index);	
ReleaseAcquisitionEngine();
ReleaseVector(dataType);
Rescale(offset, gain);
ResetOffset();
RMS();
SetAcquisitionEngine(adcChannel, refVoltage, samplingFrequency, samples, options);
SizeVector(dataType);
SizeVector(*vData, samples);
TargetPeak(targetPosition, tolerance, *result);
Windowing(windowType, dir); 
WriteData(index, data);
WriteData(dataType, index, data);

 

2 Comments

  1. pedropeixoto6 says:

    Hi,
    Where can I download this library?

  2. Didier says:

    You cannot. Please read this http://goo.gl/qIMQW (As in “Code Request” page linked on top of this blog) 😉

Leave a Reply

You must be logged in to post a comment.