-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded Music for low freq signals #1
Comments
Hi, and many thanks for your question. The libmusic will work with 56 Hz and 200-500 point FFT. The primary need addressed by this library was detection of DTMF frequencies in audio range, and this is why you can find lm_dtmf_detect function and other DTMF related things there, but library is meant to work with signals of other natures as well. The number of samples in a probe vector determines the accuracy of the detection, and depends on a number of frequencies (signal components) to be detected. It should be at least 8 times number of components, so for your 0.5 Hz and 1.2 Hz components it's at least 16 samples. The number of components should be known in advance for algorithm to give good results in the current implementation (limitation of MUSIC algorithm). RAM In your case of 2 signal components there will need to be at least this memory allocated(*):
(*) - on x86 and x86_64, but size of double may be different on your CPU/ALU Library will reuse buffers (they are allocated once per all calls to lm_detect for a given detection session). Please shout if you have any other questions. |
Thank you!! That answer is quite helpful. What are the changes you would recommend to make the code work on this environment? On the other hand, since I am trying to use it on a DSP, would it be possible to change the double variables to float? Do you suggest an example for my test? Thank you again |
Floats are possible. Which DSP you want to port this code for? Do you have SVD available on that processor? |
Probably F28379D, or something in the family. You can get a low cost board here: BTW, why are you using the names: peak_697, etc?
`` |
Those peak_* variables are only for convenience of DTMF detection, they correspond to DTMF frequencies and are only used for quick access to frequencey detection results corresponding to DTMF. Thank you for the link to the DSP board, I am having a look.
For MUSIC you need SVD to find eigenvectors corresponding to nullspace of correlation matrix. |
Where is the source code of your SVD function dgesvd? Thank you |
dgesvd comes with LAPACK. It's definition can be found here |
What are the minimum files I could use from the Laplace library to make it work on the DSP? |
Sorry, I am not sure what you mean by Laplace library? Did you mean LAPACK? |
Sorry for the delay answering. Yes, I meant LAPACK....using a low memory solution would be the target. |
Actually for SVD I was planning to use some other compilable library like: https://github.com/lucasmaystre/svdlibc What do you think? Regards |
Could be. Need to make sure you get the same results as in LAPACK tests (getting same eigenvectors is critical). Porting libmusic to use new implementation for SVD, having tests with LAPACK as a reference for new tests would be an option. But since you care about memory footprint that part of main.c from https://github.com/lucasmaystre/svdlibc may signal that you will have more stuff to do than just making sure you get right vectors:
|
As to the RAM requirements of libmusic they would be as follows:
Library has been tested against memory leaks, it is safe. |
I am reviewing the library, but Detection array is too high. I would need to detect only two main frequencies (fundamental and first harmonic), using an array of 500 points of data (max window) and detecting frequencies betwee 0.8 and 4 Hz. |
On the other hand, I would like to give it a test under Visual Studio, at least to test the results on real time on my environment. |
Yes, please reach out to me at: piotr@dataandsignal.com |
Done....email sent. I am sharing my piece of code for Music here:
|
Hello.
I am trying to implement a low memory Music algorithm to separate breathing and heart rate signals, which are 0.5Hz and 1-2Hz, on an ARM processor.
After some filtering I arrived to your implementation of Music, but I have seen that it is mostly prepared for 8kHz and 16 sample signals, and I am using 56 Hz as Fs and 200-500 sample points FFTs.
Would it be too difficult or memory dependant to adapt this library?
Thank you
The text was updated successfully, but these errors were encountered: