Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 3 FirstFirst 1 2 3
Results 51 to 65 of 65

Thread: A few questions regarding FFTs and performance

  1. #51
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    107
    And here is the schematic with all values corresponding to what I am using now, I will delete the previous schematics

    Click image for larger version. 

Name:	Screenshot from 2018-06-21 22-30-01.png 
Views:	11 
Size:	90.2 KB 
ID:	14057

    Edit: it seems that this forum does not allow to remove/change earlier messages.

  2. #52
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,875
    Here is the LTspice simulation
    Click image for larger version. 

Name:	LTsim.jpg 
Views:	15 
Size:	209.8 KB 
ID:	14058
    I replaced the BC250C by an 2N5089 (also an 100 mA collector current type).
    blue is input
    red is output (differential)

    here comes your latest schematic
    Click image for larger version. 

Name:	LTSpice2.jpg 
Views:	11 
Size:	193.2 KB 
ID:	14059
    It definitely worse than the one published in the link.
    reason is biasing second transitor is explicit in original.

  3. #53
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    107
    Hi

    Thanks for that, I have loaded LTSPice some time ago but never got anything working in it ...

    I always wondered about his latest schematic. I allready have build the scheme in the middle several time. I will see if I can add the two resistors at the base of Q2. Should be possible.

    On the good side, I just done a testdrive in our garden, Common pipistrelle was as expected around and I could hear it to at least 10-15meters (tested without any controls on the detector and a fixed frequency at 45Khz). The wind has lowered this evening and it was hunting around. Next to adding the resistors I will also start working on the controls/display.

    regards
    Cor

  4. #54
    Junior Member
    Join Date
    Dec 2016
    Posts
    1

    op amps etc.

    Hi Guys
    I have been trying to work out how to make a data recorder for bat calls for a couple of years, I have been studying stm32f boards because of their low cost but the coding is beyond me. I have made a couple of different bat detectors (from other peoples designs) and have experience using different commercial bat detectors.
    I will share what I know in case its of any help to you guys.
    Heterodyning is good in the field because you can hear the change in frequencies but it is very difficult to identify different species as their calls can be very similar. For analysis back at home a recording of the frequencies is desirable. In the field a frequency divided sound alert and a flashing led is enough for me but I would like to record the frequencies and time stamp the calls. I had been thinking of just using two timers to measure the frequencies to keep things simple and using a DS3231 to give the time and a lcd keypad to set wake up and sleep times.
    Regarding microphones and opamps. I know the SPU0410 works up to 65khz and that some commercial detectors use them. I have picked up Noctules 18 20khz which you cant pick up using the cheap mics used in range finders. I have yet to test the spu any higher than 65khz because I have never come across anything higher yet.
    Sparkfun make a few opamp boards
    LMV 358 they say they work over 100khz with a couple of filter caps removed and people say they have used them for ultrasound. I have got one but not been able to test it yet. So we can expect that even if you design a different board LMV 358 will be ok and I know for definite that OPA322 will work. They must have a fast-enough slew rate.
    How does the ICS43434 microphone work with ultrasound, can frequencies lower than 15khz be filtered out.
    Regards David

  5. #55
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    107
    Hi,

    Thanks for joining in. I have the feeling that this thread has allready changed a bit from its original main topic. But the starter (@foaly) of this thread can best decide if it can be turned into a wider discussion on building a bat-detector otherwise it might be good to create one. That way people that want to build a bat detector will easier find sources/ideas and the stuff we are trying to improve.
    I am interested to hear/see how you are going to use a teensy to hear/record bats.

    For me this was the thread that brought me to this forum : https://forum.pjrc.com/threads/38988-Bat-detector
    another important thread: https://forum.pjrc.com/threads/52175...oSoundRecorder

    As you will see from looking at above threads a lot of work has been done allready to save raw data to an SD for later processing. The bat-detector design of Frank allows us to not only listen heterodyne but simultaneously look at a spectrum/waterfall graph. So a lot of things are allready very usable.

    My current aim is to get a working bat-detector that works at least as good as some heterodynes I have made but additionally has:
    - as little noise as possible
    - more accurate and easier frequency control for the heterodyne part, in my analog heterodyne the frequency is controlled by a potentiometer and I have no screen to see what frequency I am actually using. So I am just looking at a calibrated dial where the difference between tuning to 40Khz or 50Khz is just a small turn of a knob.
    - allows me to easier see what the peak-frequency or frequency range of a bat-call is
    - allows automatic tuning (user selected) to the peakfrequency

    And thats enough for now as I first want it to work really good before I allready become too creative, stereo-batdetector etc etc

    Cor

  6. #56
    Senior Member
    Join Date
    Jul 2014
    Posts
    1,875
    CorBee, you should open a new thread on Bat detection.

  7. #57
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    107
    Hi Walter,

    I am OK with that, but my main aim is to have good cooperation/sharing of ideas/codes problems. If others that are participating currently are also happy with it I will open a new thread or we can migrate to Franks (DD4WH) teensy-bat-detector thread. For me that was the real starting point.

    My progress this morning is that I got the spectrum-function working on the FFT. The image below shows in white a live full spectrum (10-96Khz), The orange vertical line is drawn from the axis to the peakvalue, so in this case its far above the noiselevels. The peak comes from my ultrasonic transducer that slowly steps through frequencies. I can see that happening live.
    Next to that I see that the spectrum has a very stable noiselevel with stable "peaks" in it that should be related to the board or other disturbances around.
    The text shows that I am using 192k samplerate and I am listening at 45Khz heterodyne.

    Click image for larger version. 

Name:	IMG_20180622_085316015.jpg 
Views:	15 
Size:	233.8 KB 
ID:	14062

  8. #58
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    107
    Hi,

    I was still "hunting" a best setting to reduce the noise from the board. With F_CPU at 180 and sampling 176k I found using MULT=2 with DIV=8 to be a lot lower/stable in noise.

    Next up is improving my hardware with some controls (rotary encoders)

    CorClick image for larger version. 

Name:	IMG_20180622_100620277.jpg 
Views:	9 
Size:	294.3 KB 
ID:	14063
    Last edited by CorBee; 06-22-2018 at 08:09 AM. Reason: added image

  9. #59
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    304
    hi CorBee, hi all!

    very nice progress!

    I have some comments on some of the posts made in the last days:

    * sample rate: please note that in order to really accurately identify a large part of the bat species (Myotis for example), you really need a frequency response at least up to 125kHz, maybe even a little more. So my suggestion: use at least a sample rate of 250ksps ! Many bats use short calls of a few milliseconds that are frequency-modulated from way over 100kHz to as low as 20kHz. Many of the harder-to-identify species can only be accurately determined to species if you have good knowledge of the start frequency, end frequency, frequency of maximum energy, pulse duration and some more parameters. For that you need the entire call including the start, that may be above 120kHz. Thats why it is important to accurately record at least up to 120/130kHz.

    * microphone response: the SPU0410 seems to work at least up to 100kHz, see my first ultrasound recordings: https://github.com/WMXZ-EU/microSoun...ple-recordings

    * ICS43434: this is a digital MEMS mic, so you do not need a preamp, but the ICS43434 does not work for ultrasound, because the max sample rate is 51.6ksps, see here: https://www.invensense.com/download-...434-datasheet/

    * OPamps & slew rate etc.: I read a little more on OPamps for amplification of audio and I found that the requirements for slew rate and gain bandwidth product are really uncritical, if you use a two-stage preamp (gain is distributed over two stages, for example 11 and 10, so total gain is 110 == 41dB) and your output signal is not too high (its +-0.6Volts peak for the Teensy ADC). However, it should be an ultra low noise type with noise density lower than about 10nV/sqrt(Hz) --> see here: https://store.invensense.com/datashe...-Circuits7.pdf

    * long unshielded wires: not sure about that: but in some of the uploaded photos you see long, unshielded wires for tiny audio signals very near to a microcontroller ;-). My suspicion is, that when using the shortest possible cable length and shielded wires, one can seriously decrease the digital noise that is being picked up by the detector, especially if you have a dynamic display for FFT etc (which produse lots of noise). But that is just my guessing :-).

    Walter, I wonder how I can use a high enough sample rate (> 250ksps) with your microSoundRecorder that has a MULT of 1 (for reason of low noise). Do I have to change manually the function I2S_dividers? Or do the reasons for using MULT of 1 do not apply if I do not use the audio board, but the built-in Teensy ADC ?

    All the best,

    Frank

  10. #60
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    107
    Hi all,

    I have also contacted Frank (DD4WH) and he agreed on moving the part in this discussion related to building/using a teensy bat-detector over to the allready exisiting thread "Teensy Bat Detector" at
    https://forum.pjrc.com/threads/38988-Bat-detector


    regards
    Cor

  11. #61

    CMSIS 5.3 Performance on Real-Time Data

    Quote Originally Posted by Foaly View Post
    Weeeeeeelllll hahaha I was actually planning on using 192kHz as sampling rate...
    Thanks for the fast answer! Good to know I'm kinda on the right track. So what I want to do is to record ultra sound (at 192kHz for a resolution of 0-81kHz) and then transpose/scale it down to the audible range. In order to do so I would like to use a phase vocoder. A phase vocoder basically uses a FFT to go from time domain to frequency domain, then does some spectral processing and finally uses the iFFT to go back to time domain. The spectral processing you were asking for is in the most basic case simply shifting the frquency bins down. More advanced algorithms do $stuff$ to preserve formats or even better algorithms also preserve transients. I was being vague, because I still don't know what I can implement, it depends on how much processing power is left. So yeah the goal is to make ultrasound audible.

    If you are suggesting using the CMSIS library is the way to go, then maybe you could explain to me where it is bundled/built/linked, what the current version is and which version I should use?
    Thanks,
    Foaly
    In terms of performance, I designed this 801 tap bandpass filter and was able to run it in real-time on the Teensy 3.6 using 2048 point forward and inverse floating point FFTs with a maximum sample rate of 350 kHz. The data were obtained from the DAC and was output to the ADC. Although I haven’t yet tried the 4096 point FFT, you should have no trouble running at 192 kHz.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Bandpass.png 
Views:	8 
Size:	14.7 KB 
ID:	14082  
    Last edited by willie.from.texas; 06-24-2018 at 02:50 PM. Reason: Typo

  12. #62
    Junior Member
    Join Date
    Jun 2018
    Location
    Northeast USA
    Posts
    8
    This is a cooool project! I think DD4WH was describing a double L filter perhaps? Click image for larger version. 

Name:	Inverted-L-type-filter.png 
Views:	6 
Size:	4.6 KB 
ID:	14084 This is a single L, with an inductor instead of the 2K resistor. I suppose the DC current requirements of the pre-amp are small enough that the 2K resistor won;t be a problem, but a small inductor or ferrite bead would provide a little more isolation of the high freq noise on the Teensie supply. The 'quality' of the capacitor is important, that is, bigger is not always better. Use a small mylar or ceramic cap in parallel with the bigger tantalum or electrolytic to make it effective at higher frequencies. And, if you keep the caps leads as short as possible it will make them more effective.
    Good luck with this, again, very cool. sounds fun.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	index.png 
Views:	5 
Size:	1.8 KB 
ID:	14083  

  13. #63
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    107
    Quote Originally Posted by DD4WH View Post
    ....

    You can find the schematics in an old ELV journal article under the link above (you have to pay 50ct for it, so I cant post it here).
    Just found the the schematic (using a different Opamp) here https://github.com/m-r-s/hearingaid-.../Pre-amplifier

  14. #64
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    304
    Hi Corbee,

    thanks for the link (although that link is probably breaking a copyright)!

    My preamp is exactly that circuit except for the following changes:

    * C4 and C7 is 100pF --> gives a lowpass cutoff frequency of 159kHz

    * delete the following: R3, R4

    * leave open: BR1 and BR2

    * opamp is TL972: 4nV/sqrt(Hz), 12MHz, 5V/s, rail-to-rail

    * I use AGND from the Teensy instead if GND

    * ST3: mic power supply, ST4: mic out, ST1: 3.3Volts from the Teensy, ST6: amplified Audio out going to the bias circuit and then to pin 16 (A2) of the Teensy

    Beware: as far as I know, the opamp given under the link will not work properly for 3.3V supply voltage, because it is not a rail-to-rail type (and it has higher noise than the TL972).

    Frank

  15. #65
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    107
    Hi Frank,

    Thanks for the additional info, for me this is currently too difficult to assemble. I have never worked with SMD parts but its good to have this recorded for those that read this later on.

    Cor

Posting Permissions

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