Forum Rule: Always post complete source code & details to reproduce any issue!
Page 5 of 5 FirstFirst ... 3 4 5
Results 101 to 107 of 107

Thread: Audio Recording / Logging to SD card --> microSoundRecorder

  1. #101
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,813
    Quote Originally Posted by garthpaine View Post
    Hi Walter

    I can't believe it got stuck in customs so long - amazing.... also thanks for investing in one - I would have sent you mine, but as you can see it is a neat package and a good quality I/O - I am actually in residence at ZKM in Karlsruhe for the next couple of months and do have mine with me so will test it out - thanks so much.

    I wonder when you have a chance would it be possible to add the trigger function so I can add a light sensitive resistor to the flash of a wildlife camera and extend recording if going and or start recording if not? I am hoping to use this feature in a project synchronized with wildlife cameras in the new year.

    Cheers, Garth
    Garth,
    there were really 2 shipping attempts: USPS to Italy failed in customs (Tympan returned to US) and UPS to Germany (overall 1 week).
    In both cases, custom complained on missing shipping documents. in the USPS case custom is also interface between USPS and Italian postal system, so effectively nobody cared to obtain the necessary documentation and after a month held in custom package returned. Anyhow, international shipping needs special skills (documentation). Strange, Digikey's UPS shipping passes German custom in 5 minutes and Italian custom in a day or so, therefore international shipping must be possible.


    Concerning the external triggered acquisition, there is a potential problem.
    It is easy when Teensy is running and only snippets are archived, which is similar to what is already implemented: data driven logging.
    If you also wanted to save battery power, there are a couple of options
    - hibernate as now: this needs restart (could be RTC , /RESET, or other LLWU pins)
    - sleep at higher level: needs code to reactivate acquisition

    actual hibernate is lowest consumption. Other mode consume more.

    also, any shutdown of acquisition inhibits recording before event, and may also need a couple of seconds to switch on acquisition.

    So question is: is power consumption critical, is pre-trigger recording important?

  2. #102
    Hi Walter

    Thanks for your kind consideration of this feature.

    The top priority for this mode would be - pre-triggred recording and immediate response. Of course power consumption is critical too but secondary to the first 2 considerations in this mode

    It is designed to capture the environmental context in which a wildlife picture is taken. For instance we want to know about communities of Mule dear which do not cross the road, which is causing a separation of gene pools. The Mule dear are photographed quite often and I would like to know what the activity on the road is when the dear are captured on wildlife cameras close to the road, so that we might get a fuller picture of the conditions that prevent them crossing the road. We are also likely to use this in Costa Rica looking at some other issues related to context when animals are present in the photographs.

    Much obliged to you for your generosity

    Kind regards, Garth

  3. #103
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,813
    Quote Originally Posted by garthpaine View Post
    The top priority for this mode would be - pre-triggred recording and immediate response. Of course power consumption is critical too but secondary to the first 2 considerations in this mode
    OK, this can be done, do you have a pin you wanted to add an external trigger, how do you want the trigger (falling/rising edge?)
    Note that more than half the memory size (100 kB) should not be allocated for pre-trigger (25 kS for stereo i.e. 0.5 s at 50 kHz)
    I recall you wanted also regular noise samples recorded, right?

    BTW, I find the Tympan a really nice system for logging.

    Garth, if you get it working, maybe you could provide some info on application for the WIKI, (and note on tympan blog (I saw your entry)).

  4. #104
    Hi Walter

    Wonderful - thank you. I am using the environmental sensing boards (not the light at this stage, but possibly later) so am not concerned about the pin used - any free pin would be fine. I guess the voltage increases on the light sensitive resistor rises with the presence of light so it would need to be a rising edge trigger – but I must admit I am not an expert on the electronics

    I was thinking this would be analog - I would keep it simple
    https://www.sparkfun.com/products/9088

    or this
    https://www.sparkfun.com/products/8688

    But others might have a better suggestion

    Yes, in addition to this function I would want to maintain the normal logging function which I currently have set up to record 2, 4 minute files every 10 minutes from 3 AM to midday and midday to midnight.

    Thanks, Garth

  5. #105
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,813
    OK,
    I will look into it.
    One thing I should say, I only modified the code to get it running, I have NOT yet checked if data quality is OK, in particular if sampling rates are OK.
    So, if recording sound strange, simply tell me.

    BTW, at the moment only the top 16 bit are used. not sure if the codec is better than that.

  6. #106
    Junior Member
    Join Date
    Sep 2018
    Posts
    1
    Hi all,

    I'm currently working on a project (with @garthpaine) using Teensy 3.6 to build a gunshot detection & location system for an anti-poaching initiative in Costa Rica. I have seen a few other threads regarding systems with similar goals, however because this is in the beginning stage I am using the singular MEMS mic setup for initial "shot detection only" tests. Along with this I am also using the microSoundRecorder code as a starting point, so I felt it more fitting to post here. (Thanks so much @WMXZ for sharing this code as it has helped me learn backwards in regards to what code is causing what outcomes)

    My goals for testing are as follows...

    1. Monitor amplitude peak vector, subtracting mean background amplitude from a reference frame captured say every 10 minutes (we will do this as it is rainforest and the ambient amplitude will vary greatly during 24 hrs).

    2. Upon threshold of ambient amplitude being passed, run 1024 FFT.

    3. Use FFT to calculate spectral centroid vector over a period of a ~10 frame buffer (sample rate dependent, hoping 96k will be a possibility.) we are looking for the amplitude and spectral centroid vectors to have rapid change in opposite directions

    4. Calculate the angle or length of the amplitude or loudness vector and the spectral centroid vector

    5. If the amplitude vector is sufficiently steep (long) and the spectral centroid vector is also very steep in the opposite direction
    ie. If they are greater than a set threshold (ie. Acceleration)

    6. Write a text file to the SD card containing an array of the amplitude & SC values in the buffer.

    7. Write that buffered bit of audio on the SD card as well so verification of the shot can be made through playback after. This will allow me to take a single system in the field and feed it some test shots from varying distances and locations.

    8. Send message to central server using IoT low powered radio indicating listening device number and shot detected triangulation will be done on a PC which will then send an SMS to security staff


    - My question is: Given the audio stream is present can you suggest how I can insert the amplitude change function, FFT function and associated vector functions in this code?
    - I am also very open to any input on how you think the workflow could be improved?

    I think the microSoundRecorder is a good base as it already does all the MEM handling and SD file writing, and can be scheduled. I see there is also a thresholding function which could be called perhaps when the vectors are above threshold of rate of change.

    Being fairly new to C I am struggling with where exactly to begin this process in the code itself, and any/all input would be very much appreciated. Thank you all so much!

    Kyle

  7. #107
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,813
    Quote Originally Posted by kylehoefer View Post

    I'm currently working on a project (with @garthpaine) using Teensy 3.6 to build a gunshot detection & location system for an anti-poaching initiative in Costa Rica.
    Kyle,
    I really like your application.

    I should be possible to extend the existing recorder SW to do the processing you wanted to do, or even more.

    The items under 2 - 4, while I think I understand what you are meaning, needs more reading from my side. Do have some papers in mind that describe the processing?

    Concerning programming (or understanding the code), you always can contact me at walter (at) wmxz.eu. I would be delighted to help your project.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •