Forum Rule: Always post complete source code & details to reproduce any issue!
Page 20 of 22 FirstFirst ... 10 18 19 20 21 22 LastLast
Results 476 to 500 of 540

Thread: Bat detector

  1. #476
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    260

    SGTL5000 tests Part5: REFCTRL and median Noise

    Noise in the silent sections
    After splitting the wav-files into signal and "silence" I calculated the median and the 5%,95% percentiles of the "silence" to get an idea of the bandwidth of the noise.

    Click image for larger version. 

Name:	noise-G00-G08.png 
Views:	3 
Size:	46.7 KB 
ID:	17688
    The above image shows for a single samplerate (192K) and two diffferent gains (GAIN=0, GAIN=20) these bands (blue=95%, red=median, green=5%). On the X-axis the settings for REF_CTRL can be seen (rightmost is the default 01F2). The lowest 3 lines correspond to a GAIN of 0 and show that the lower REF_CTRL until 0132 settings deliver at least 5dB less noise. The other set of lines shows a completely different pattern where the lower REF_CTRL settings produce a stronger background-signal. For GAIN=20 the band is also far wider at the lower REF_CTRL settings.

    Click image for larger version. 

Name:	signal and noise.png 
Views:	2 
Size:	24.7 KB 
ID:	17689
    This image shows signal-strength(green) and the median-noise (red, the same as in the 1st graph) for the same settings (192K, GAIN=0, GAIN=20) of REF_CTRL.

    Click image for larger version. 

Name:	contrast.png 
Views:	4 
Size:	83.0 KB 
ID:	17691
    And the results can than be used to calculate the difference (or contrast) between the strength of the signal (dB) and the median "silence" in dB for all tested GAIN settings between 0 and 20. This reveals a clear pattern, at lower GAINs changing REF_CTRL to a lower value increases the contrast between the signal and the "silence". For GAIN=20 this difference is only a few dB but at GAIN=0 this difference is a lot bigger.

    But this is not simply the same for all samplerates !

    Click image for larger version. 

Name:	contrast-all.png 
Views:	3 
Size:	68.4 KB 
ID:	17692
    This image shows the contrast between signal/silence for GAIN=20 and all tested samplerates. For most sample-rates this more or less is stable, changing REF_CTRL at GAIN20 thus increases both signal and "silence" in an alike manner. Also notice that the contrast is ordered by samplerate, the lowest samplerate delivers the best contrast.

    Click image for larger version. 

Name:	contrast-G00-all.png 
Views:	2 
Size:	113.0 KB 
ID:	17693
    The same image for GAIN=0, the response is very different for samplerates and REF_CTRL. No clear conclusion can be drawn based on this graph. When I saw these graphs at first I was wondering if the recordings were OK. But after looking at a few spectrograms I suddenly saw that there were always frequency bands in the "silent" part of the recording. Oddly enough the location of these noise-bands was not static (as I was expecting) but they were drifting based on the changes in samplerate/REF_CTRL and GAIN. So the changes in the average noise we saw thusfar are partially due to the fact that one or more of these bands suddenly appeared/disappeared in the spectrum.

    So ... the results look inconclusive and show that one can be easily tricked into seeing "hopeful" results when not all settings are tested in a standardized way. In the next part of this story I will try to show another way of looking at the noise. For that I will not be using the silence but only the recorded signal and testing for harmonics.
    Last edited by CorBee; 09-24-2019 at 07:25 AM.

  2. #477
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,398
    Quote Originally Posted by aethertech View Post
    Greetings to everyone,

    I have been following this thread as time permits with great interest. I have a fair degree of experience with analog and analog to digital conversion at the frequencies of interest. Being an "analog guy", I can only tip my hat in envy to the digital gurus once the analog crosses into the digital domain.

    That said, I do have a few suggestions.
    I concur with all you said.
    Unfortunately, the SGTL5000 audioboard costs really nothing, compared to a genuine ultrasonic ADC board with proper signal conditioning.

  3. #478
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    195
    I love to see people getting quantitative. Fantastic.

    As some friendly improvements:

    * The term "signal to noise ratio" (SNR) is typically used instead of "contrast". You define what you consider to be your input signal (say, 10mV sine wave at 40 kHz) and then you measure the signal level and the background noise and report the ratio (or difference, if using dB). I think that this is very similar to what you're doing...it's probably just a difference in language.

    * You should consider showing the frequency spectrum at the various test points. It we would illustrate where the noise is changing in frequency space, which is probably more helpful than broadband numbers. Many folks are interested in some frequency ranges more than others, so if you report that noise is increasing only in selected areas of frequency space, the increase in noise could be irrelevant to some folks yet a critical failure for others. Showing frequency spectra really helps a reader know how these noise levels might affect their application. (Unfortunately, it's notoriously hard to get the units right when doing FFT spectral analyses of signals...but, if you are using spectra to report SNR instead of absolute signal levels, it usually works out correctly as long as you use the same FFT parameters when analyzing your signal and when analyzing your noise.)

    * When one increased the sample rate, any broadband measure of noise would be expected to go up, so that's not a surprise in your results. The observed broadband noise level should because the bandwidth of the system has been increased by increasing the sample rate. If the system is limited by its self noise, and if the system's self noise is white, doubling the sample rate should increase a broadband measure of self noise by 3 dB. Or, conversely, the broadband SNR should drop 3 dB. At any given frequency, however, one hopes that the noise level would stay the same (when reporting noise on a per Hz basis, such as via a frequency spectrum plot). Again, this is a reason why showing frequency spectra is common in these kinds of explorations.

    * Finally, when you change the gains, it is typical to report measured noise levels (and measured signal levels) as "input referred". This means that, if you increase the gain on your device by 3 dB, and you find that the digital values that you measure also go up by 3dB, the "input referred" levels are unchanged because (once you account for the known system gains and refer your measured values back to inputs of your device), your measurements would not have seen any difference...a 10mV input still looked like a 10 mV input. Usually, this kind of thing is made more clear by reporting your noise and signal levels (even after digitization) in units of volts, or some other real world physical unit. In your data, even if you were to report noise values on an input referred basis, it appears that there is an increase in self noise under some conditions. These are the interesting points to identify (and avoid)!

    Again, it's so great to see quantitative analysis. These suggestions are meant to be friendly so that more folks can get into them!

    Chip
    Last edited by chipaudette; 09-24-2019 at 04:01 PM.

  4. #479
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    260
    Hi Chip,

    Thanks for having a look. Going through the bullets although I dont mind getting these

    1) I was using contrast as a term as we simply show the difference between for instance peakvalues and the background-noise. I had the feeling SNR was in need of another (real) calculation.
    2) We have shown in the earlier graphs that there is no strong frequency-effect in the signal, so I wonder where you are pointing at. I have all the data (nearly 3Gb) ready for processing so I can add/change calculations if its clear what needs to change.
    3) see 2, please tell more clearly what you want to see. Be aware that this is the output of nearly 600 datafiles each spanning around 10 seconds of data and a sweep from 20-60Khz. Enough data to swamp things but its always possible to look at something specific.
    4) Thanks for that suggestion, we have kept all input constant at 0.05Vpp

    Keep the comments coming as this is a test to find out what we can get out of this chip without breaking it !

    Cor

  5. #480
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    195
    If you're curious, I did a self-noise analysis of the Teensy Audio board for a subset of the audible frequency range (not ultrasound)...

    http://openaudio.blogspot.com/2017/0...elf-noise.html

    Chip

  6. #481
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    260
    I have seen those before, but it does not answer (at least for me) what you would like to see from the samples we collected. You want to see a spectrum of the so-called "silence" ?

  7. #482
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    195
    Note in my blog post how I show the spectrum of the self noise with and without the HP filter engaged. My two spectra reveal the chacteristics of the noise added by that HP filter: several very strong narrowband peaks. Ick! This is quite different then seeing a broad whitenoise-like increase in noise. It was a very curious finding that also corroborated what one's ears could hear.

    Similarly, if you were to show the spectrum of the self noise at different sample rates, one could see whether the noise at any given frequency stays the same (as one would hope). Or, if the self noise goes up, is it worse in some frequency areas vs others? Or, do narrowband peaks of noise appear at certain sample rates?

    Moving beyond sample rate, such graphs could also answer similar questions regarding the impact on self-noise of changing the gain.

    (To be clear, I have no specific questions myself as I've already decided that this board is too noisy for my needs. So, my comments are aimed merely at the kinds of questions that a future hypothetical user *might* have and the kinds of analyses that might answer those questions.)

    Chip (a lover of graphs)

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

    I think now understand your question. The narrow peaks you see are not visible in the spectra I have seen, they might be present but can also be swamped by other noise. We have looked at disabling the HP before and found no differences. So our setup is cleary very different from yours and probably less sensitive.

    As stated in one of the previous postings its very clear that the "self-noise"/"silence" shows changing characteristics. Some frequencies seem have "static" noise and are always present and other noise shows not up at a standard position and shifts frequency based on changes in GAIN and/or REF_CTRL. In a sequence with increasing REF_CTRL settings I have for instance seen a noise-band moving at each change a bit higher in the frequencies whilst samplerate and everything else stayed the same. But often these signals are <80dB and not that interesting for this apparatus since we are not using it as a "normal" hearing-aid

    Cor

  9. #484
    Quote Originally Posted by CorBee View Post
    Hi

    Welcome to this forum ! I am interested to hear and see your progress in building the batdetector. Several people have been building the system using either the transistor or the IC opamp and it would be nice to see the results of your proposed changes. As I am not a hardware person I am mainly interested in following the improvements people have proposed which often have been helpfull in getting a better signal/noise. For me the biggest step thusfar was to change from a wired-up system using perfboard to a proper designed PCB (by edwin), that helped a great deal in lowering the unwanted system-noise (for instance due to the TFT) creeping in the system.

    Have you tried simulating the differences you propose in the hardware in for instance LT-SPICE, previously that has been used to share ideas for the pre-amp. On the SGTL5000 you state not using the gain at all and using the line-input. I have tried using the line-input in the past and with the preamp I had at that time the signal was far to weak to be usefull. You also state that the gain probably will give an increase in the THD. Today I hope to share the results of the tests we (edwin and I) have run recently with respect to background-noise at different gain settings and also the harmonics

    Once again, welcome !

    regards
    Cor
    CorBee.

    Thanks for the welcome!

    Better than simulating the circuit, it has been built and measured. At 35dB of gain and at 40kHz, the circuit approaches -100dB THD (.001%). It works well out to 180kHz. Driven by this circuit, the ADC's THD performance and the mic's self noise will dominate overall.

    I am hoping Edwin will respond and allow me to suggest moving a few things around on his schematic, make the discussed component changes, and utilize the second opamp section as a second order LP inserted prior to the LINE input.

    As for the signal being too weak, the amps gain can be increased up to 45 dB and still remain well below -90THD. However, 35dB of gain is a good starting point and should be adequate. Note that the first gain stage (preamp) sets the maximum S/N that can be achieved. Any gain after the preamp makes both the signal AND the noise louder (and adds even a bit more noise) so the maximum achievable S/N is determined at the preamp. As above, the mic's self noise and the ADC's THD specs will then dominate the detector's overall performance.

    A 40kHz piezo transducer makes a good acoustic source when driven from a low THD sine, but they still produce a bit of 2nd harmonic. Sometimes driving them slightly off their center frequency can reduce their THD a bit. Again, you need a clean sine wave to drive them for this purpose.

    When I get the time, I'll build this detector (hoping someone will tell me how to switch to no internal gain and LINE input) and will feed some clean sines into the ADC to make some measurements.

    aethertech
    Last edited by aethertech; 09-24-2019 at 06:09 PM.

  10. #485
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    260
    Hi,

    I am sure Edwin will have a look at your remarks. And when you build one, it will be absolutely simple to switch to line-input and no-gain is a software setting !

    Cor

  11. #486
    Also,

    The 5000 has a register for setting internal bias. Typically this can be used to set the bias below the default setting to reduce power consumption. I suspect that the best THD performance can be had at the default setting, or even moreso at the one setting available higher than the default. Greater current swinging typically yields better performance...

    aethertech

  12. #487
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    260
    The current BIAS is part of the REF_CTRL setting of the SGTL. Default it is set to 2 which means 12.5% above nominal. This setting can be changed to 0% (nominal) and down to -50%. We have tested this but the effects seem to be little

  13. #488
    Quote Originally Posted by CorBee View Post
    The current BIAS is part of the REF_CTRL setting of the SGTL. Default it is set to 2 which means 12.5% above nominal. This setting can be changed to 0% (nominal) and down to -50%. We have tested this but the effects seem to be little
    The only way to determine any performance change with the bias setting (or use of internal gain) would be to feed a clean sine (<-100THD) into the line in and look at the spectrum produced. If using the mic and existing preamp while driven from a not so clean acoustic source, I suspect their performance would likely swamp any discernible changes in the ADC'c performance.

    aethertech

  14. #489
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    260
    Quote Originally Posted by aethertech View Post
    The only way to determine any performance change with the bias setting (or use of internal gain) would be to feed a clean sine (<-100THD) into the line in and look at the spectrum produced. If using the mic and existing preamp while driven from a not so clean acoustic source, I suspect their performance would likely swamp any discernible changes in the ADC'c performance.

    aethertech
    We have not used the MIC and preamp in our tests ...

  15. #490
    Quote Originally Posted by CorBee View Post
    We have not used the MIC and preamp in our tests ...
    What are you using as a signal source?

  16. #491
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    260
    Quote Originally Posted by aethertech View Post
    What are you using as a signal source?
    You can read that all in the first posting I made after we have done the tests, post #464.

  17. #492
    Quote Originally Posted by CorBee View Post
    You can read that all in the first posting I made after we have done the tests, post #464.
    I could not find the specs for the SY6600 but a similar model (FY6600) states -45dB THD for sine waves below 1MHz. I suspect it is a bit better than that at the frequencies being used, but being a 14 bit DDS there will be a fair amount of distortion produced.

    I do not quite understand the reed relay setup. I would install a 10R to 51R resistor at the PCB between the input and ground and then feed the signal into the input end of the resistor. I typically feed this from a 600R source generator, but your DDS has a 50R output impedance. I would add another 100R to 500R either at the gen output or the circuit input. The low impedance (the installed 10R to 51R resistor) simulates the low impedance output from an opamp and also forms a voltage divider with the gen's 50R and the added 100R to 500R series resistance. This forces you to increase the gen's output and attenuates noise that may be picked up along the way.

    For a noise test, just disconnect the signal source and measure with the 10R installed.

    aethertech

    Added:

    Of course you will want to install a DC blocking cap between the circuit's input and the 10R to 51R installed at the input. Use something like a 100uF electrolytic for this cap.

  18. #493
    Member
    Join Date
    Nov 2018
    Location
    Netherlands
    Posts
    87
    Quote Originally Posted by aethertech View Post
    What are you using as a signal source?
    Hi aethertech, the signal source is a cheap 60mhz yunec DDS signal generator. JDS6600
    R1 and C2 are not used, C1 and C3 are small velues to help keep all the low frequencies out. I know this is not the best way to filter things out but I had problems with some sallen key filtering I was trying to use (sorry if I use the wrong name but I guess you understand)

    C5 did not really need to be big because of the high frequencies hat we are using but it would not hurt to use a higher value I guess.

    R2 is actually a resistor close to the microphone impedance I also did not place C4 in the latest boards I made.

    I have a 2.2uF capacitor on R2 (C6) but I actually used 100uF becaus I had a lot of very nice tiny 100uf Sanyo electrolytical capacitors.
    Iguess you mean pin 5 of the opamp should better be connected to VCC/2 via a 10K resistor and not directly put tp VCC/2


    TL972 was used because of the low noise r-r capabilities in a standard dip package so the people with SMD-fobia can still work om it.
    LT6203 also looked promising but I did not compare to the AD4841-2 Yes I used a dual opamp, Not juist because I played with some filtering before but it seems TL972 was more available than TL971

    The boards design I have now does also have a set of SOIC pads but maybe TSSOP would have been a better choice.

    I am willing to try your ideas but I would really like to keep the low frequencies out.

    there is a 1uf capacitor on the microphone board between V+ abd GND

    Kind regards,

    Edwin

  19. #494
    Senior Member CorBee's Avatar
    Join Date
    Jun 2018
    Location
    Netherlands
    Posts
    260
    Hi,

    Its Edwin's setup and the reason for the relay is simple ... we needed to be able to record many test-sequences in a row without having to manually connect/disconnect anything. Collecting many 100s of files needs automating, hence the 555 controlling a relay.

    Cor

  20. #495
    Quote Originally Posted by pe1pwf View Post
    Hi aethertech, the signal source is a cheap 60mhz yunec DDS signal generator. JDS6600
    R1 and C2 are not used, C1 and C3 are small velues to help keep all the low frequencies out. I know this is not the best way to filter things out but I had problems with some sallen key filtering I was trying to use (sorry if I use the wrong name but I guess you understand)

    C5 did not really need to be big because of the high frequencies hat we are using but it would not hurt to use a higher value I guess.

    R2 is actually a resistor close to the microphone impedance I also did not place C4 in the latest boards I made.

    I have a 2.2uF capacitor on R2 (C6) but I actually used 100uF becaus I had a lot of very nice tiny 100uf Sanyo electrolytical capacitors.
    Iguess you mean pin 5 of the opamp should better be connected to VCC/2 via a 10K resistor and not directly put tp VCC/2


    TL972 was used because of the low noise r-r capabilities in a standard dip package so the people with SMD-fobia can still work om it.
    LT6203 also looked promising but I did not compare to the AD4841-2 Yes I used a dual opamp, Not juist because I played with some filtering before but it seems TL972 was more available than TL971

    The boards design I have now does also have a set of SOIC pads but maybe TSSOP would have been a better choice.

    I am willing to try your ideas but I would really like to keep the low frequencies out.

    there is a 1uf capacitor on the microphone board between V+ abd GND

    Kind regards,

    Edwin
    Edwin,

    The problem with using the smaller value caps is that it increase the impedances seen throughout the circuit and will produce more noise. Same for reducing the values of the feedback and shunt resistor. Resistor noise increase with higher resistance.

    I would try the circuit as I outlined and worry about low frequencies later. Your cone is going to give you gain at HF by producing a more cardioid pattern, but will likely cut-off rather steeply below 15-20k. This may be sufficient to allay your concerns regarding low frequencies. If necessary, you can decrease the value of C3 to produce a LF rolloff. The lower value you chose for R2 is reducing the mic output several dB.

    I have used the 6203 considerably, but the 4841 is pretty sweet and has lower noise and way more gas available at high gains/frequencies than the 972. I plan to use an SOIC to dip adapter for the board. I use the SOT23-5 package a lot.

    Consider the following:

    Edit your schematic with the values I indicated in previous post.

    Move the entire first opamp section's circuit to the left a bit and the serial connector down to make way for a second order low pass using the second opamp section.

    Move R2 so that it extends upward from C1 and connect its upper most end to VCC/2. You might consider adding the additional resistor and decoupling cap as discussed in series with VCC/2 and the top of R2.

    The second stage is now down there clear of obstructions/connections. Move it over directly under IC1A and down a little bit (that's why the serial connector needed to be moved)

    Connect two 2K resistors in series, placed horizontally to the left of IC1B. The free end of the rightmost resistor connects to pin 5 (the + input) of IC1B.

    Connect pin 1 (IC1A output) directly to the leftmost end of the left resistor in the series string added to the IC1B + input (disconnect pin 1 from C5 as well).

    Connect a cap (820pF) from pin 7 (IC1B output) to the junction of the two series resistors (place it over the top of IC1B).

    Connect another cap (330pF) from pin 5 (the +input) to ground (move the series resistors left as needed to make room for this cap).

    Connect pin 7 (IC1B output) to the left side of C5.

    Leave the pin 7 to pin 6 connection as drawn (as a voltage follower)

    You now have a second order unity gain LP filter in series between the preamp and the 5000 input. The -3dB point is around 160k and is fairly steep.

    Make it look pretty and post it if you have the time.

    aethertech

  21. #496
    The problem I see is that when the reed relay is open, so is the input to the circuit. With no low impedance source connected, the noise floor is going to be very high. Connect a low value resistor (10R to 51R as mentioned) across the detector's input. That way when the relay is open, the input sees a low impedance path to signal ground. With the 10R (and your 50 ohm source), you'll have to crank up the output of the DDS 15dB or so but you will get better measurements.

    A few static measurements, like a picture, are worth a thousand words...

    aethertech

  22. #497
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,398
    @aethertek
    did you say a picture is worth a thousand words?
    would you mind to draw your schematic suggested in #495?

  23. #498
    Member
    Join Date
    Nov 2018
    Location
    Netherlands
    Posts
    87
    Well I do hope your 1000 words are all in this picture....

    Probably missed something.... I don't like the 2k resistors by the way, I have all E12 resistors so 2k2 would have suited me better :-)

    Click image for larger version. 

Name:	amp2.png 
Views:	17 
Size:	23.1 KB 
ID:	17701

    Please let me know where I messed up (or did not)

    I just read the previous posts, did not realize any of you was talking about pictures and a thousand words, did not meen to offend anyone.
    spice does show this seems to give the described effect, I was just wondering though, would it not be better to filter before amplifying?


    Edwin
    Last edited by pe1pwf; 09-24-2019 at 09:45 PM.

  24. #499
    Quote Originally Posted by pe1pwf View Post
    Well I do hope your 1000 words are all in this picture....

    Probably missed something.... I don't like the 2k resistors by the way, I have all E12 resistors so 2k2 would have suited me better :-)

    Click image for larger version. 

Name:	amp2.png 
Views:	17 
Size:	23.1 KB 
ID:	17701

    Please let me know where I messed up (or did not)

    I just read the previous posts, did not realize any of you was talking about pictures and a thousand words, did not meen to offend anyone.
    spice does show this seems to give the described effect, I was just wondering though, would it not be better to filter before amplifying?


    Edwin

    Come on you guys, you're dealing with an old fart who has little time on his hands. Please give me a break...

    Edwin,

    Everything is correct except R2 should be 10K. Your gonna' lose about 6dB from the mic with that 470R (and the added loading will increase the mic's THD).

    Other comments:

    Leave a placeholder cap at the original (old C2) position. May need it later for RF.

    Put the 22pF (old C4) back in across the feedback resistor (new R4). May remove or increase it later (some performance is layout/strays related and you want to be able to compensate).

    Is VCC/2 used anywhere else on the pcb? If so, add a 1K between VCC/2 and the supply side of the new R2. Add a 10uF decouple cap to ground at the junction of the two resistors. If VCC/2 is not used anywhere else, you're good to go (just rem to change that 470R R2 to 10K).

    Add a 10R resistor between C5 and the DAC input. May not be needed but again, sometimes helps with RF/spikes.

    When I build mine (soon I hope) I will likely build this entire circuit on its own PCB. I may add another second order, i.e., make it a fourth order LP, if needed.

    I will also separate power and signal grounds so I can play around with various ground schemes to eliminate any ground/ground loop related noise and THD (the opamp and DAC supply currents are typically very non-linear and if any ground Vdrop leaks into the signal path, THD goes up).

    And so it is, just as a picture is worth a thousand words, a thousand words can also be worth a picture...

    Great job Edwin.

    aethertech

  25. #500
    Edwin,

    Don't forget to consider using an ADA4841-2 for this circuit.

    aethertech

Posting Permissions

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