Author Topic: FFT and 60 Notch filter software  (Read 3583 times)

0 Members and 1 Guest are viewing this topic.

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
FFT and 60 Notch filter software
« on: March 11, 2024, 05:18:23 am »
Hi, I need an FFT software and Notch filter software that can analyze the components of the waveforms and interferences directly from the ADC (with generic voltage input fed to the ADC that Audacity can easily read, meaning no coding of any kind)  to tell what frequencies of the output are involved. And also attempt to 60 Hz Notch filter it with brick wall response from 59 to 61 Hz.

The software can be combined in one or separate and must be free. Or cost so little. Know any?  Thanks.

2064053-0
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: FFT and 60 Notch filter software
« Reply #1 on: March 11, 2024, 05:35:39 am »
Both things come with Audacity by default.

The notch filter even defaults to 60 Hz, since they anticipate it as the most common use.
Alex
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #2 on: March 11, 2024, 07:05:24 am »
Both things come with Audacity by default.

The notch filter even defaults to 60 Hz, since they anticipate it as the most common use.

Great to know that. Do you know how to convert Audacity file to one that can be read by Matlab in general (and EEGLab in particular)?
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14481
  • Country: fr
Re: FFT and 60 Notch filter software
« Reply #3 on: March 11, 2024, 07:22:21 am »
Matlab can read WAV files, so that's probably your easiest path.
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: 00
Re: FFT and 60 Notch filter software
« Reply #4 on: March 11, 2024, 07:32:29 am »
EDFbrowser has many  kinds of (notch-)filters:

https://www.teuniz.net/edfbrowser/

The files generated can be read by matlab.

 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #5 on: March 11, 2024, 09:42:15 am »
Matlab can read WAV files, so that's probably your easiest path.

If Matlab can read WAV files. why cant EEGLab read WAV files since EEGLab runs in Matlab? see

https://www.researchgate.net/post/what_file_formats_are_possible_to_load_in_EEGLAB
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14481
  • Country: fr
Re: FFT and 60 Notch filter software
« Reply #6 on: March 11, 2024, 09:55:04 am »
 

Offline Andy Chee

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: au
Re: FFT and 60 Notch filter software
« Reply #7 on: March 11, 2024, 10:41:00 am »
Matlab can read WAV files, so that's probably your easiest path.
If Matlab can read WAV files. why cant EEGLab read WAV files since EEGLab runs in Matlab?
If you don't want to manually code the WAV import into MATLAB array, then try using the Biosig plugin with EEGLAB.

https://eeglab.org/tutorials/04_Import/Importing_Continuous_and_Epoched_Data.html
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #8 on: March 11, 2024, 11:02:13 am »
Once the OP has managed to notch out 60Hz, he'll probably realise it is 60Hz+-allowed variability.

Then he might want to notch out the harmonics, since modern mains waveforms are not sinusoidal.

The first time I looked at that this millennium, I thought something was wrong with the scope, transformer, etc. Nope: the problem was with the waveform.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: 00
Re: FFT and 60 Notch filter software
« Reply #9 on: March 11, 2024, 11:20:02 am »
Once the OP has managed to notch out 60Hz, he'll probably realise it is 60Hz+-allowed variability.

Then he might want to notch out the harmonics, since modern mains waveforms are not sinusoidal.

The first time I looked at that this millennium, I thought something was wrong with the scope, transformer, etc. Nope: the problem was with the waveform.

And then he might probably realize that notch filters can create ringing with particular waveforms, for example with EKG.
Usually, the best approach is to avoid powerline interference from being recorded.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #10 on: March 11, 2024, 11:35:19 am »
Once the OP has managed to notch out 60Hz, he'll probably realise it is 60Hz+-allowed variability.

Then he might want to notch out the harmonics, since modern mains waveforms are not sinusoidal.

The first time I looked at that this millennium, I thought something was wrong with the scope, transformer, etc. Nope: the problem was with the waveform.

And then he might probably realize that notch filters can create ringing with particular waveforms, for example with EKG.
Usually, the best approach is to avoid powerline interference from being recorded.

Definitely!

He could always try to notch out the ringing  >:D
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: rhb

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 8173
  • Country: fi
Re: FFT and 60 Notch filter software
« Reply #11 on: March 11, 2024, 06:54:35 pm »
Then he might want to notch out the harmonics, since modern mains waveforms are not sinusoidal.

Yeah. Anyone who ever worked with audio and tried to filter out mains hum by using a band-stop filter, realized a long time ago it's a futile task. Heck, you can hear that the hum is much more than the 50 or 60Hz component. Harmonics go to kHz range.

The only way really is to design audio (or other measurement) circuits such that they don't pick up the interference in the first place, or interference is cancelled e.g. by differential design, where cancellation happens with wide BW.
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #12 on: March 11, 2024, 11:11:31 pm »
Both things come with Audacity by default.

The notch filter even defaults to 60 Hz, since they anticipate it as the most common use.

I created a 2.5mV 60Hz output using a Netech simulator. It displayed in Audacity. When I used the notch filter at 60Hz. The waveform disappeared so it is not on at default.
When I tried Frequency Analysis. Why don't I get just a peak at 60Hz (or 50Hz), instead, it shows many frequencies up to 9kHz like the following. I also attached the audio file. I need a frequency analyzer that will only show the 60Hz sine wave (or other frequency) in the display. I want one that will show the frequency in the plots. Attached is the 60Hz audio file so other can also check if the frequency is only 60HZ or a range of frequencies up to 9kHz not showed at Audacity?

* Netech 2point5mV 60Hz output.wav (1652.6 kB - downloaded 24 times.)

2065991-1
« Last Edit: March 11, 2024, 11:14:59 pm by loop123 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: FFT and 60 Notch filter software
« Reply #13 on: March 11, 2024, 11:37:53 pm »
The waveform disappeared so it is not on at default.
I did not say it was on by default. This is not even how Audacity works, nothing is on by default. The workflow if such that you apply plugins. I said that the default value when you apply the filter is 60 Hz.


When I tried Frequency Analysis. Why don't I get just a peak at 60Hz (or 50Hz), instead, it shows many frequencies up to 9kHz like the following.
Enable logarithmic scale for the frequency axis and increase the size of the FFT.

This is basic FFT stuff. If you can't figure that out at this point, you are not likely to get anywhere.
Alex
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #14 on: March 11, 2024, 11:46:05 pm »
I created a 2.5mV 60Hz output using a Netech simulator. It displayed in Audacity. When I used the notch filter at 60Hz. The waveform disappeared so it is not on at default.
When I tried Frequency Analysis. Why don't I get just a peak at 60Hz (or 50Hz), instead, it shows many frequencies up to 9kHz like the following.

Welcome to the world of windowing functions, e.g. Hanning, Hamming, flat-top, Blackman, and many others. Do you want to emphasise amplitude precision, frequency precision, a balance?

Thought experiment: if you have a 999Hz sinewave that is turned on/off at 10Hz, what do you think the frequency domain equivalent is - or should be?
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: newbrain

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #15 on: March 11, 2024, 11:46:36 pm »
The waveform disappeared so it is not on at default.
I did not say it was on by default. This is not even how Audacity works, nothing is on by default. The workflow if such that you apply plugins. I said that the default value when you apply the filter is 60 Hz.


When I tried Frequency Analysis. Why don't I get just a peak at 60Hz (or 50Hz), instead, it shows many frequencies up to 9kHz like the following.
Enable logarithmic scale for the frequency axis and increase the size of the FFT.

This is basic FFT stuff. If you can't figure that out at this point, you are not likely to get anywhere.

Done. So the other frequencies shown besides 60Hz is the noise floor?  What kind of application where it will only show the 60Hz and the component frequencies from Fourier breakdown of the frequencies actually displayed. This is what I want to see. Not the inclusion of noise floor or whatever the wide frequency in the plot.

2066033-0
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #16 on: March 11, 2024, 11:48:57 pm »

So the other frequencies shown besides 60Hz is the noise floor? 
No.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: FFT and 60 Notch filter software
« Reply #17 on: March 11, 2024, 11:50:26 pm »
Done. So the other frequencies shown besides 60Hz is the noise floor?
They are artifacts of the transform and quantization. You can apply different windowing functions and see how they change.


What kind of application where it will only show the 60Hz and the component frequencies from Fourier breakdown of the frequencies actually displayed. This is what I want to see. Not the inclusion of noise floor or whatever the wide frequency in the plot.

You are looking at it at the result of the transform. You can extract the full information. There is an export button where it will save this information into the file and you can take whatever you need.

I don't understand what you want from it, so it is hard to tell what to do exactly.
Alex
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #18 on: March 11, 2024, 11:53:24 pm »
This is actually what I want. I inputted 10 microvolt 50Hz into the amplifier I always get this waveforms and not a uniform sine wave. I even enclosed the electrodes in metal box so it is shielded from capacitive coupling and intereference current. What I want to know is what is causing the interference such tha the waveforms are distorted and not pure 10uV 50Hz sine wave?

2066051-0
« Last Edit: March 12, 2024, 03:25:39 am by loop123 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: FFT and 60 Notch filter software
« Reply #19 on: March 11, 2024, 11:57:40 pm »
I inputted 10 microvolt 50Hz into the amplifier I always get this waveforms and not a uniform sine wave.
What makes you think your source is a pure sine wave in a first place? Have you characterized your amplifier for noise and distortion?

You are working with very low levels and shitty electrical setups. Of course there will be all sorts of distortions.

I don't see how FFT would be of a lot of help here.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11261
  • Country: us
    • Personal site
Re: FFT and 60 Notch filter software
« Reply #20 on: March 12, 2024, 12:16:47 am »
Besides FFT. How to know what frequencies cause the interference or noises?
What is wrong with FFT? It is perfectly adequate.

It is said enclosing the whole setups in Faraday Cage can eliminate the distortion. True?
Depends on the source of the distortion. If your amplifier is crap, no matter how much you enclose it, it will remain crap.

I'm done with this this topic. I mistakenly did not ignore it from the start.
Alex
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7742
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #21 on: March 12, 2024, 12:19:47 am »
Just so you are aware, if you are making sampling tech which needs to notch out 50hz and 60hz, if I remember correctly, Analog Devices makes a 24bit ADC which has an absurd built in 21 tap, or more, digital filtering processor specifically designed for that task to deal with AC emi and it's overtones.  It had something like an insane 180db reject on those 2 frequencies.

I once designed scales for food filling machines which had to sample really fast, yet reject the food feed vibration beds which were controlled by the my electronic scale.

It just requires 1 crystal and it provides you a clock with a fixed sample rate.  You can gang them together using only 1 crystal to create a huge channel sampling system with channel to channel perfect reject of those tones.
« Last Edit: March 12, 2024, 12:21:35 am by BrianHG »
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #22 on: March 12, 2024, 01:19:50 am »
The amp (model AMP01) used in the commercially built equipment is not crap. It is one of the best with noise of 5 nV/sqrt(Hz) so at 100 Hz bandwidth, the noise rms is 50nV or 0.05uV so 10uV signal should have no problem. If I increase the signal to 30microvolt, 50Hz. The following is nice sine wave output with no distortion (using 100Hz bandidth too in amp). It is only when I used 10microvolt that I got the distortion. Using the 10uV wav file I shared in last message. Guys pls help determine the frequencies interfering with it. From the file, can you tell if the noise is external or in the circuit??

2066222-0
« Last Edit: March 12, 2024, 01:48:01 am by loop123 »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14481
  • Country: fr
Re: FFT and 60 Notch filter software
« Reply #23 on: March 12, 2024, 02:05:43 am »
Just so you are aware, if you are making sampling tech which needs to notch out 50hz and 60hz, if I remember correctly, Analog Devices makes a 24bit ADC which has an absurd built in 21 tap, or more, digital filtering processor specifically designed for that task to deal with AC emi and it's overtones.  It had something like an insane 180db reject on those 2 frequencies.

Yes. They have many of them actually, for instance the AD7190.
 

Offline Andy Chee

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: au
Re: FFT and 60 Notch filter software
« Reply #24 on: March 12, 2024, 02:15:17 am »
From the file, can you tell if the noise is external or in the circuit??
Are you only measuring one channel/electrode, or multiple channels/electrodes?  Your photo only shows one waveform, so I'm assuming you're only measuring a single channel/electrode.

If you measure multiple electrodes, you can mathematically remove the common noise.  The theory is that the skin potentials will be different at each electrode, but the noise (particularly 60Hz and other EMI) will be the same in all channels. 

EEGlab can do this multiple channel common noise reduction, and I'm pretty sure Audacity should be able to do it with two channel stereo.  The key is that you need multiple channels, not single.
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #25 on: March 12, 2024, 03:23:19 am »
From the file, can you tell if the noise is external or in the circuit??
Are you only measuring one channel/electrode, or multiple channels/electrodes?  Your photo only shows one waveform, so I'm assuming you're only measuring a single channel/electrode.

If you measure multiple electrodes, you can mathematically remove the common noise.  The theory is that the skin potentials will be different at each electrode, but the noise (particularly 60Hz and other EMI) will be the same in all channels. 

EEGlab can do this multiple channel common noise reduction, and I'm pretty sure Audacity should be able to do it with two channel stereo.  The key is that you need multiple channels, not single.

Sorry. The following audio attachment (at bottom) is the file showing the distortions in the 10uV, 50Hz signal input, you have to zoom in the amplitude at Audacity or other editors to see them. I used single electrode pair connected to the Netech EEG simulator as shown in photo. My concern is the waveforms are distorted and even after I shielded the entire Netech and connector box. I still got distortions. So I just want to see the Fourier breakdowns of the waveforms to see what is the component frequencies causing the interference (if it is external or in the circuit). Please try loading it in Audicity and let me know. Your description about using multiples samples is a separate task. Remember at 30uV and higher, no distortions. only in the 10uV which happens to be the region I'd focus in.

2066369-0

2066375-1

2066381-2

 

Offline Andy Chee

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: au
Re: FFT and 60 Notch filter software
« Reply #26 on: March 12, 2024, 05:53:32 am »
From the file, can you tell if the noise is external or in the circuit??
Are you only measuring one channel/electrode, or multiple channels/electrodes?  Your photo only shows one waveform, so I'm assuming you're only measuring a single channel/electrode.

If you measure multiple electrodes, you can mathematically remove the common noise.  The theory is that the skin potentials will be different at each electrode, but the noise (particularly 60Hz and other EMI) will be the same in all channels. 

EEGlab can do this multiple channel common noise reduction, and I'm pretty sure Audacity should be able to do it with two channel stereo.  The key is that you need multiple channels, not single.
I used single electrode pair connected to the Netech EEG simulator as shown in photo.

Your description about using multiples samples is a separate task.

It's actually not a separate task, all the channels can be done all together.  Noise removal is performed on all channels simultaneously, not individual channel one-by-one.
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #27 on: March 12, 2024, 06:04:56 am »
From the file, can you tell if the noise is external or in the circuit??
Are you only measuring one channel/electrode, or multiple channels/electrodes?  Your photo only shows one waveform, so I'm assuming you're only measuring a single channel/electrode.

If you measure multiple electrodes, you can mathematically remove the common noise.  The theory is that the skin potentials will be different at each electrode, but the noise (particularly 60Hz and other EMI) will be the same in all channels. 

EEGlab can do this multiple channel common noise reduction, and I'm pretty sure Audacity should be able to do it with two channel stereo.  The key is that you need multiple channels, not single.
I used single electrode pair connected to the Netech EEG simulator as shown in photo.

Your description about using multiples samples is a separate task.

It's actually not a separate task, all the channels can be done all together.  Noise removal is performed on all channels simultaneously, not individual channel one-by-one.

What I want to determine for now is whether the noise is caused by EMI or the amplifier not capable of 10uV as Ataranov remarked. Bec even if I spent $3000 on human size Faraday cage. The distortion would still be there if it is the amplifier that has problem. If thats the case, then have to dive and spent $5000 on USBamp software and actives if it is the only means of last resort. So how do you know if the distortion is really caused by EMI or the amplifier just not capable of handling 10uV even if the amp used is the 5nV/sqrt(Hz) noised AMP01?

I just want to know the frequencies involved in the distortions for now and not about eliminating them right away.
« Last Edit: March 12, 2024, 06:06:37 am by loop123 »
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7742
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #28 on: March 12, 2024, 06:10:16 am »

What I want to determine for now is whether the noise is caused by EMI or the amplifier not capable of 10uV as Ataranov remarked. Bec even if I spent $3000 on human size Faraday cage. The distortion would still be there if it is the amplifier that has problem. If thats the case, then have to dive and spent $5000 on USBamp software and actives if it is the only means of last resort. So how do you know if the distortion is really caused by EMI or the amplifier just not capable of handling 10uV even if the amp used is the 5nV/sqrt(Hz) noised AMP01?

I just want to know the frequencies involved in the distortions for now and not about eliminating them right away.
Oh, so you must be doing your tests somewhere along Salaberry Blvd in Dollard Des Ormeaux / or in Kirkland...
Good luck, you will never get rid of that interference in that area of town.
« Last Edit: March 12, 2024, 06:12:18 am by BrianHG »
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #29 on: March 12, 2024, 08:09:41 am »

So in Audacity Frequency analysis, the frequency sides are being displayed. I want an app that can see the components (inside in illustration) in the following. What is the software called?

2066738-0
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1417
  • Country: us
  • Very dangerous - may attack at any time
Re: FFT and 60 Notch filter software
« Reply #30 on: March 12, 2024, 05:09:44 pm »
Band-pass filter.

You really seem to be 'in over you head' on this.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #31 on: March 12, 2024, 06:44:33 pm »
Or he could look at p374 in https://www.worldradiohistory.com/UK/Wireless-World/70s/Wireless-World-1974-10.pdf and find an article "Mains Rejection Tracking Filter - using a tracking 'n-path' filter with wide dynamic range" to remove not only the fundamental but also the harmonics.

Not many people understand weird and wonderful n-path filters. I expect it would blow the OP's mind.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: BrianHG

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7742
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #32 on: March 13, 2024, 12:47:41 am »
Or he could look at p374 in https://www.worldradiohistory.com/UK/Wireless-World/70s/Wireless-World-1974-10.pdf and find an article "Mains Rejection Tracking Filter - using a tracking 'n-path' filter with wide dynamic range" to remove not only the fundamental but also the harmonics.

Not many people understand weird and wonderful n-path filters. I expect it would blow the OP's mind.
I completely forgot about that concept.  Yes, done right, you can eliminate the mains interference completely.  However, if loop123 is using his amp to read human biometrics, you have the problem that every time you re-wire to a new person in a different place, you may too radically change your source interference characteristics.

If loop123 has enough input channels, just sacrifice 1 channel as you mains reference noise channel.  Then, subtract that channel's signal from all your channels of interest and you will null out your main's noise.

It's basically how a differential line signal works.
« Last Edit: March 13, 2024, 12:51:22 am by BrianHG »
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #33 on: March 13, 2024, 01:57:57 am »
Or he could look at p374 in https://www.worldradiohistory.com/UK/Wireless-World/70s/Wireless-World-1974-10.pdf and find an article "Mains Rejection Tracking Filter - using a tracking 'n-path' filter with wide dynamic range" to remove not only the fundamental but also the harmonics.

Not many people understand weird and wonderful n-path filters. I expect it would blow the OP's mind.
I completely forgot about that concept.  Yes, done right, you can eliminate the mains interference completely.  However, if loop123 is using his amp to read human biometrics, you have the problem that every time you re-wire to a new person in a different place, you may too radically change your source interference characteristics.

If loop123 has enough input channels, just sacrifice 1 channel as you mains reference noise channel.  Then, subtract that channel's signal from all your channels of interest and you will null out your main's noise.

It's basically how a differential line signal works.

For now the input is a Netech sine wave simulator. In the following 10uV (microVolt), 50Hz source is used because the simulator only has 0.1Hz, 2Hz, 5hz, 50Hz, 60Hz setting. And I can't chose 60Hz because the Audacity notch filter can totally null all amplitude.

In the following, the BMA200 Amp has 1000Hz bandwidth selected. Enclose in it is the Frequency Analysis. How do you remove the noises? What noises do you call them? It is the same input as the original file but only now the Amp bandwidth has 1000Hz selected instead of just 100Hz. Attached is also the audio file. Please check using your FFT what noises are they comprised off. If I 60Hz notch filter it, the amplitude went down but the noises remain. Please try to find ways to remove the noises and share what you did. From the Frequency Analysis below, what frequencies are the noises? If they are harmonics, where are the frequencies of the harmonics located in the FFT. Thanks!

2068250-0



 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7742
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #34 on: March 13, 2024, 06:23:52 am »
Oh man, that 6.7khz tone in the .wav is maddening.  And I see a main dominant 50hz spike. There was a weaker 60hz and 80hz tones as well.  Are you sure this was recorded in north America?  Or, did you attempt some sort of filter algorithm which injected some fundamentals?

 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #35 on: March 13, 2024, 07:06:16 am »
Oh man, that 6.7khz tone in the .wav is maddening.  And I see a main dominant 50hz spike. There was a weaker 60hz and 80hz tones as well.  Are you sure this was recorded in north America?  Or, did you attempt some sort of filter algorithm which injected some fundamentals?

Thats bec the source is the Netech EEG simulator which produces 10uV, 50Hz output into the amplifier which is set at 1000Hz bandwidth. What is the origin of the noises at each waveform? No I didnt inject any filter algorithm. It is directly from the BMA-200 amplifier to the E1DA ADC (the world highest performing 32 bit ADC) and direct to Audacity. The ambient AC capacitive coupling in the location is 60Hz. Are the noises harmonics?  Pls break it down into the fourier component FFT style and recover the 10uV, 50Hz input. I want to see examples how you fix it.
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: 00
Re: FFT and 60 Notch filter software
« Reply #36 on: March 13, 2024, 07:29:54 am »
Synchronize the sampleclock of the ADC to the powerlinefrequency e.g. using a PLL.
That makes it way easier to remove the powerline interference (including harrmonics).

https://www.mainsfrequency.com/

 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #37 on: March 13, 2024, 09:46:05 am »
First, please tell me what exactly are these noises? In the 2nd image, they don't look like harmonics:

2068928-0

2068934-1

If they are harmonics. They should be resultant in the waveform. But my audacity waveforms don't show any resultant. The noises are riding in each part of the sine wave. How do you differentiate between EMI, RFI, amplifier noise, and quantization ADC noises? How sure are you they are powerline noises or harmonics? Please tell me what exactly those are first.
« Last Edit: March 13, 2024, 10:42:42 am by loop123 »
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #38 on: March 13, 2024, 10:39:58 am »
Synchronize the sampleclock of the ADC to the powerlinefrequency e.g. using a PLL.
That makes it way easier to remove the powerline interference (including harrmonics).

https://www.mainsfrequency.com/

I talked to the designer of E1DA. Ivan said:

2068976-0

Well. Ivan is a Russian electronics wizard. If he could say that. How can I even counter it. Ok. Someone please give an actual example how to filter the waveforms in the file I sent 2 messages prior. Please do it directly using your Apps, then I'll filter hundreds of other inputs myself after you actually showed the filter output by actually running it in your software. Thanks.
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: 00
Re: FFT and 60 Notch filter software
« Reply #39 on: March 13, 2024, 10:50:03 am »
Synchronize the sampleclock of the ADC to the powerlinefrequency e.g. using a PLL.
That makes it way easier to remove the powerline interference (including harrmonics).

https://www.mainsfrequency.com/

I talked to the designer of E1DA. Ivan said:

(Attachment Link)

Well. Ivan is a Russian electronics wizard. If he could say that. How can I even counter it. Ok. Someone please give an actual example how to filter the waveforms in the file I sent 2 messages prior. Please do it directly using your Apps, then I'll filter hundreds of other inputs myself after you actually showed the filter output by actually running it in your software. Thanks.

That's because your samplerate is not an integer multiple of the powerline frequency.
I thought we were talking about EEG and/or EKG here and you could select the samplerate.

If your application is about recording audio, then it's much easier to get rid of powerline interference (compared to EEG/EKG)
but you need to pay attention to grounding.
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #40 on: March 13, 2024, 11:13:00 am »
Synchronize the sampleclock of the ADC to the powerlinefrequency e.g. using a PLL.
That makes it way easier to remove the powerline interference (including harrmonics).

https://www.mainsfrequency.com/

I talked to the designer of E1DA. Ivan said:

(Attachment Link)

Well. Ivan is a Russian electronics wizard. If he could say that. How can I even counter it. Ok. Someone please give an actual example how to filter the waveforms in the file I sent 2 messages prior. Please do it directly using your Apps, then I'll filter hundreds of other inputs myself after you actually showed the filter output by actually running it in your software. Thanks.

That's because your samplerate is not an integer multiple of the powerline frequency.
I thought we were talking about EEG and/or EKG here and you could select the samplerate.

If your application is about recording audio, then it's much easier to get rid of powerline interference (compared to EEG/EKG)
but you need to pay attention to grounding.

My amplifier target input is 10uV, 1000Hz with gain of 50000.  The output bandwidth is set at 1000Hz. So the output is 10uVx50000= 0.5V, 1000Hz.  The ADC is to record the 0.5V, 1000Hz.  What samplerate must I adjust in Audacity so I can filter the powerline frequency and harmonics? 
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: 00
Re: FFT and 60 Notch filter software
« Reply #41 on: March 13, 2024, 11:23:03 am »
Synchronize the sampleclock of the ADC to the powerlinefrequency e.g. using a PLL.
That makes it way easier to remove the powerline interference (including harrmonics).

https://www.mainsfrequency.com/

I talked to the designer of E1DA. Ivan said:

(Attachment Link)

Well. Ivan is a Russian electronics wizard. If he could say that. How can I even counter it. Ok. Someone please give an actual example how to filter the waveforms in the file I sent 2 messages prior. Please do it directly using your Apps, then I'll filter hundreds of other inputs myself after you actually showed the filter output by actually running it in your software. Thanks.

That's because your samplerate is not an integer multiple of the powerline frequency.
I thought we were talking about EEG and/or EKG here and you could select the samplerate.

If your application is about recording audio, then it's much easier to get rid of powerline interference (compared to EEG/EKG)
but you need to pay attention to grounding.

My amplifier target input is 10uV, 1000Hz with gain of 50000.  The output bandwidth is set at 1000Hz. So the output is 10uVx50000= 0.5V, 1000Hz.  The ADC is to record the 0.5V, 1000Hz.  What samplerate must I adjust in Audacity so I can filter the powerline frequency and harmonics?

Change the recording samplerate of your device from 44.1 KHz to 48 KHz which is an integer multiple of 60 (and 50) Hz.
Design a PLL controlled VCO that creates the clock for your ADC chip and synchronize it with the powerline frequency.
That gives you much more options to use sophisticated algorithms in order to remove the powerline interference.

But we can help you better if you tell us what you want to achieve. What is it what you want to measure? Audio? Something else?
 

Offline WatchfulEye

  • Regular Contributor
  • *
  • Posts: 110
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #42 on: March 13, 2024, 11:37:25 am »
First, please tell me what exactly are these noises? In the 2nd image, they don't look like harmonics:

If they are harmonics. They should be resultant in the waveform. But my audacity waveforms don't show any resultant. The noises are riding in each part of the sine wave. How do you differentiate between EMI, RFI, amplifier noise, and quantization ADC noises? How sure are you they are powerline noises or harmonics? Please tell me what exactly those are first.

You seem to be looking for an individiual frequency as the source of your noise/distortion. It actually appears that this is broadband noise/noise floor that you are seeing. Also, a hint when using the audacity spectrum viewer - you need to amplify the signal first, as the viewer has a fixed minimum on the Y axis. You can then magnify as required in the spectrum viewer.

This is the spectrum of the last waveform you posted. I've also calculated normalised amplitudes for narrow band noise, on the basis that the signal is 10 uV rms.

You can see the 50 Hz signal, and small 2nd and 3rd harmonics. You can also see a small amount of 60 Hz noise (1 uV), but no harmonics.
However, there are 2 unknown and more important noise sources - 78 Hz (1.7 uV) as well as harmonics of 78 Hz, and broadband noise (approx 100 nV/sqrt Hz).

The 60 Hz is likely coming from power line noise, and could be mitigated with better shielding, or the use of a notch filter (depending on the frequencies of interest in your signal), or differential measurement.
The 78 Hz is a mystery, and may be noise generated by the simulator.
The broadband noise may be the noise floor of your setup, and because of it's 1 kHz bandwidth, it has a total contribution of approx 3 uV.

I suggest repeating the measurements with other waveforms and amplitudes, to see what happens to the unknown noise sources. It may be that some of the unknown noise is from your waveform generator.

 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #43 on: March 13, 2024, 11:41:52 am »
Synchronize the sampleclock of the ADC to the powerlinefrequency e.g. using a PLL.
That makes it way easier to remove the powerline interference (including harrmonics).

https://www.mainsfrequency.com/

I talked to the designer of E1DA. Ivan said:

(Attachment Link)

Well. Ivan is a Russian electronics wizard. If he could say that. How can I even counter it. Ok. Someone please give an actual example how to filter the waveforms in the file I sent 2 messages prior. Please do it directly using your Apps, then I'll filter hundreds of other inputs myself after you actually showed the filter output by actually running it in your software. Thanks.

That's because your samplerate is not an integer multiple of the powerline frequency.
I thought we were talking about EEG and/or EKG here and you could select the samplerate.

If your application is about recording audio, then it's much easier to get rid of powerline interference (compared to EEG/EKG)
but you need to pay attention to grounding.

My amplifier target input is 10uV, 1000Hz with gain of 50000.  The output bandwidth is set at 1000Hz. So the output is 10uVx50000= 0.5V, 1000Hz.  The ADC is to record the 0.5V, 1000Hz.  What samplerate must I adjust in Audacity so I can filter the powerline frequency and harmonics?

Change the recording samplerate of your device from 44.1 KHz to 48 KHz which is an integer multiple of 60 (and 50) Hz.
Design a PLL controlled VCO that creates the clock for your ADC chip and synchronize it with the powerline frequency.
That gives you much more options to use sophisticated algorithms in order to remove the powerline interference.

But we can help you better if you tell us what you want to achieve. What is it what you want to measure? Audio? Something else?

Surface biopotentials of 10uV, 1000Hz. Experimenting on bionics implants. It will be difficult to "Design a PLL controlled VCO that creates the clock for your ADC chip and synchronize it with the powerline frequency.". Who has actually built them?  can you guys just do it on existing software? are you saying no software can even filter them? but pls answer 2 messages prior what those noises are in the first place bec they seemed not to be harmonics owing to lack the resultant as shown in the figure.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #44 on: March 13, 2024, 11:56:41 am »
Surface biopotentials of 10uV, 1000Hz. Experimenting on bionics implants. It will be difficult to "Design a PLL controlled VCO that creates the clock for your ADC chip and synchronize it with the powerline frequency.". Who has actually built them?  can you guys just do it on existing software? are you saying no software can even filter them? but pls answer 2 messages prior what those noises are in the first place bec they seemed not to be harmonics owing to lack the resultant as shown in the figure.

For medical electronics, especially implants, it is essential that you use hardware designed for such purposes in a way specified by the manufacturer.

Any homebrew hardware or hardware operated in a system not designed for medical purposes may be a safety hazard. The tone of your repeated questions makes me doubt that you are qualified to design and/or operate such hardware. Hence be very careful of the consequences of your actions and inactions. Consult the terms and conditions of relevant professional insurance policies, looking to see whether you might be personally liable.

If the digitiser has adequate dynamic range (see the ENOB specification) and higher than necessary sampling rate, then downconverting to any lower rate is a standard DSP operation with well known consequence. Consult any DSP textbook, and use DSP software. Do not expect standard audio hardware and software to be sufficient.

Wrtng sntncs like this mks u lk unprofessional.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1182
  • Country: de
Re: FFT and 60 Notch filter software
« Reply #45 on: March 13, 2024, 12:11:05 pm »
Is the .wav file supposed to contain any useful information?
Besides the spurs, everything looks like random noise to me :-//
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: 00
Re: FFT and 60 Notch filter software
« Reply #46 on: March 13, 2024, 12:37:57 pm »
Surface biopotentials of 10uV, 1000Hz. Experimenting on bionics implants. It will be difficult to "Design a PLL controlled VCO that creates the clock for your ADC chip and synchronize it with the powerline frequency.". Who has actually built them?  can you guys just do it on existing software? are you saying no software can even filter them? but pls answer 2 messages prior what those noises are in the first place bec they seemed not to be harmonics owing to lack the resultant as shown in the figure.

For medical electronics, especially implants, it is essential that you use hardware designed for such purposes in a way specified by the manufacturer.

Any homebrew hardware or hardware operated in a system not designed for medical purposes may be a safety hazard. The tone of your repeated questions makes me doubt that you are qualified to design and/or operate such hardware. Hence be very careful of the consequences of your actions and inactions. Consult the terms and conditions of relevant professional insurance policies, looking to see whether you might be personally liable.

If the digitiser has adequate dynamic range (see the ENOB specification) and higher than necessary sampling rate, then downconverting to any lower rate is a standard DSP operation with well known consequence. Consult any DSP textbook, and use DSP software. Do not expect standard audio hardware and software to be sufficient.

Wrtng sntncs like this mks u lk unprofessional.

If the device is not advertized as a medical device, for example when it's intended use is for research only, you can do almost whatever you want
(prohibited the approval of an ethical commision).
As soon when it's going to be used for patient treatment and/or monitoring, you'll need to comply with EN/CEI 60601 and all the applicable/resulting other norms...


 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #47 on: March 13, 2024, 12:52:00 pm »
Is the .wav file supposed to contain any useful information?
Besides the spurs, everything looks like random noise to me :-//

It is just sine wave generator output of 10uV, 50Hz sine wave. Simple only but why is the output at Audacity has so much noise? Goal is simply to remove the noise and regain the pure 10uV, 50Hz sine wave. pls help do that.

Btw the amplifier is for use on mice so dont worry guys. see specs at

https://cwe-inc.com/products/bma-200-acdc-bioamplifier
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1182
  • Country: de
Re: FFT and 60 Notch filter software
« Reply #48 on: March 13, 2024, 01:45:39 pm »
Is the .wav file supposed to contain any useful information?
Besides the spurs, everything looks like random noise to me :-//
It is just sine wave generator output of 10uV, 50Hz sine wave. Simple only but why is the output at Audacity has so much noise? Goal is simply to remove the noise and regain the pure 10uV, 50Hz sine wave. pls help do that.

My understanding was that the 50 Hz component (and the other spurs) are interfering signals which you want to suppress. If, OTOH, the 50 Hz signal is the useful signal you want to keep (while all the other spectral components should be suppressed), then this can easily be done with a narrow bandpass filter. However, I think this is not what you really want. A real EEG signal is not a pure 50 Hz sine wave, therefore such a bandpass filter would suppress most of the useful components in a real EEG signal. Is the EEG simulator not able to simulate a more realistic EEG signal?
« Last Edit: March 13, 2024, 01:47:20 pm by gf »
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: 00
Re: FFT and 60 Notch filter software
« Reply #49 on: March 13, 2024, 02:01:59 pm »
I opened your wav file in EDFbrowser and it doesn't look noisy.

 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #50 on: March 13, 2024, 02:08:48 pm »
Is the .wav file supposed to contain any useful information?
Besides the spurs, everything looks like random noise to me :-//
It is just sine wave generator output of 10uV, 50Hz sine wave. Simple only but why is the output at Audacity has so much noise? Goal is simply to remove the noise and regain the pure 10uV, 50Hz sine wave. pls help do that.

My understanding was that the 50 Hz component (and the other spurs) are interfering signals which you want to suppress. If, OTOH, the 50 Hz signal is the useful signal you want to keep (while all the other spectral components should be suppressed), then this can easily be done with a narrow bandpass filter. However, I think this is not what you really want. A real EEG signal is not a pure 50 Hz sine wave, therefore such a bandpass filter would suppress most of the useful components in a real EEG signal. Is the EEG simulator not able to simulate a more realistic EEG signal?

2069240-0

Above is the specs of the Netech simulator I'm using. It can only output 0.1, 0.5, 2, 50, and 60 Hz.  I chose 50Hz signal. The amplitude choices are 10, 30, 50, 100, 500 μV, 1,2, and 2.5 mV.  I chose 10μV signal.  And I fed the 50Hz, 10uV signal into the BMA-200 bioamplifier. And connect the BNC output of the BMA-200 to the E1DA Cosmos ADC and into Audacity. 

Yes, 50Hz is the signal, not the noise. It's just to test the unit. So if 10uV, 50Hz sine wave is the signal. Why does Audacity show it with so many noises like in following? Are they harmonics? but where is the resultant in 2nd image?  This is only present if 10uV are used and not only higher amplitude signal which has better SN Ratio.

2069246-1

2069252-2


Please remove the noises and present the pure 10uV, 50Hz output from the Netech simulator.
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #51 on: March 13, 2024, 02:16:55 pm »
I opened your wav file in EDFbrowser and it doesn't look noisy.

The one you downloaded is the 2.5mV, 60Hz output from Netech Simulator. Instead download the attached one with 10uV, 50Hz signal from the Netech simulator.

I loaded at audacity now and the following is the waveform

2069261-0
« Last Edit: March 13, 2024, 02:52:01 pm by loop123 »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1182
  • Country: de
Re: FFT and 60 Notch filter software
« Reply #52 on: March 13, 2024, 03:18:40 pm »
That's what I get if I notch out 60Hz and 78 Hz and cut-off the bandwidth at 100 Hz. What bandwidth do you need to keep?
Audacity has notch and lowpass filters, too, so I guess you could do the same in Audacity.
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #53 on: March 13, 2024, 03:24:41 pm »
That's what I get if I notch out 60Hz and 78 Hz and cut-off the bandwidth at 100 Hz. What bandwidth do you need to keep?
Audacity has notch and lowpass filters, too, so I guess you could do the same in Audacity.

Did you used my audio file above? I want to keep 1000Hz. I just ran EDFbrowser for first time and loaded it up but I can't find how to run the Amplitude FFT done by Karel. where to find it. He loaded  up the 2.5mV file, not the 10uV, 1000hz file which is in my last message. Please remove the noises and retain 1000Hz, 10uV.

2069411-0
 

Offline WatchfulEye

  • Regular Contributor
  • *
  • Posts: 110
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #54 on: March 13, 2024, 03:34:36 pm »
Most of the noise is between 50 Hz and 1000 Hz - it is broad band noise, not at any specific frequency.
Apart from the 60 and 78 Hz spurs, the only way to reduce the noise is reduce the bandwidth. You cannot keep up to 1000 Hz and reduce the noise any further with any simple filter process.

 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #55 on: March 13, 2024, 03:40:39 pm »
First, please tell me what exactly are these noises? In the 2nd image, they don't look like harmonics:

If they are harmonics. They should be resultant in the waveform. But my audacity waveforms don't show any resultant. The noises are riding in each part of the sine wave. How do you differentiate between EMI, RFI, amplifier noise, and quantization ADC noises? How sure are you they are powerline noises or harmonics? Please tell me what exactly those are first.

You seem to be looking for an individiual frequency as the source of your noise/distortion. It actually appears that this is broadband noise/noise floor that you are seeing. Also, a hint when using the audacity spectrum viewer - you need to amplify the signal first, as the viewer has a fixed minimum on the Y axis. You can then magnify as required in the spectrum viewer.

This is the spectrum of the last waveform you posted. I've also calculated normalised amplitudes for narrow band noise, on the basis that the signal is 10 uV rms.

You can see the 50 Hz signal, and small 2nd and 3rd harmonics. You can also see a small amount of 60 Hz noise (1 uV), but no harmonics.
However, there are 2 unknown and more important noise sources - 78 Hz (1.7 uV) as well as harmonics of 78 Hz, and broadband noise (approx 100 nV/sqrt Hz).

The 60 Hz is likely coming from power line noise, and could be mitigated with better shielding, or the use of a notch filter (depending on the frequencies of interest in your signal), or differential measurement.
The 78 Hz is a mystery, and may be noise generated by the simulator.
The broadband noise may be the noise floor of your setup, and because of it's 1 kHz bandwidth, it has a total contribution of approx 3 uV.

I suggest repeating the measurements with other waveforms and amplitudes, to see what happens to the unknown noise sources. It may be that some of the unknown noise is from your waveform generator.

2069501-0

Oh. I missed this message. Is the waveform you downloaded the one with lots of noises, like above? That's what I wanted to know, whether it is just powerline harmonics or the noise floor already. But the noise of the AMP01 used in BMA-200 is 5nV/sqrt (Hz). So at 1000Hz bandwidth, the noise is actually 0.158uV. Where did you get the 100nV/Sqrt (Hz)? 
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #56 on: March 13, 2024, 03:44:16 pm »
Most of the noise is between 50 Hz and 1000 Hz - it is broad band noise, not at any specific frequency.
Apart from the 60 and 78 Hz spurs, the only way to reduce the noise is reduce the bandwidth. You cannot keep up to 1000 Hz and reduce the noise any further with any simple filter process.

What was what I wanted to know since message 1 of this thread. Whether this is powerline noises or noise floor already. Did you ran them at Audacity? How did you choose the LPF in the last 3 images?   But the AMP01 has 5nV/sqrt (Hz) noise or 0.158uV at 1000Hz. So with 10uV signal, the noise floor is very small fraction.

« Last Edit: March 13, 2024, 03:45:47 pm by loop123 »
 

Offline WatchfulEye

  • Regular Contributor
  • *
  • Posts: 110
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #57 on: March 13, 2024, 03:50:12 pm »
Only the 60 Hz noise is powerline.

There is a mystery 78 Hz noise.

The main noise is broadband noise - which looks like noise floor, but by my calculations it is about 100-150 nV/sqrt Hz - much higher than specified noise of the AMP01. It could be noise from the waveform generator.

However, note that BMA-200 specifies 7uV noise - and your recording shows less noise than this.

You could try measuring the noise directly by using a 1 kohm resistor instead of the waveform generator. It would be interesting to have a series of recordings with different waveforms and 1 with just a resistor - all settings left exactly the same.
« Last Edit: March 13, 2024, 03:55:16 pm by WatchfulEye »
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #58 on: March 13, 2024, 03:56:00 pm »
Only the 60 Hz noise is powerline.

There is a mystery 78 Hz noise. The main noise is broadband noise - which looks like noise floor, but by my calculations it is about 100-150 nV/sqrt Hz - much higher than specified noise of the AMP01.

However, note that BMA-200 specifies 7uV noise - and your recording shows less noise than this.

I don't know how the 0.158uV rms noise at 1000Hz at the AMP01 became so bad at the BMA-200. But is it really possible to make an amplifier that can deal with clean 10uV, 1000Hz bandwidth signal? Is there a known device that can do this already? Using AMP01, why can't one make this?

I'll try the resistor measurement tomorrow.. please let me know what can imitate 10uV too instead of using the Netech simulator.
« Last Edit: March 13, 2024, 03:58:55 pm by loop123 »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1182
  • Country: de
Re: FFT and 60 Notch filter software
« Reply #59 on: March 13, 2024, 04:20:48 pm »
Here is the accumulated spectral power up to 1kHz. The big jump is the wanted signal. Even the spurs result only in small jumps. Everything else is wideband noise as you see. It makes sense to lowpass filter at 1kHz to get rid of the top 5% beyond 1kHz.

EDIT: I should not have labeled the plot with "noise power", but rather spectral power.
« Last Edit: March 13, 2024, 04:22:23 pm by gf »
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2218
  • Country: 00
Re: FFT and 60 Notch filter software
« Reply #60 on: March 13, 2024, 04:59:50 pm »
I just ran EDFbrowser for first time and loaded it up but I can't find how to run the Amplitude FFT done by Karel. where to find it.

To view the powerspectrum of a signal, leftclick on the signallabel and choose "Spectrum".

https://www.teuniz.net/edfbrowser/EDFbrowser%20manual.html#Powerspectrum
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7742
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #61 on: March 13, 2024, 05:28:13 pm »
LOL, you could just apply a deep 3D statistical FFT noise remover algorithm.  (There is an 20 year old audio editor which can do it, but, I don't think its what you want since it requires example sample noise to work with, then it removes just that noise and leaves everything else automatically.  Though, it only supports 24bit integer sampling, maybe 32bit floats.)

However, since you have been delivered a simulated sample and not working with true hardware where you can make sure there is no 60hz/50hz noise from the source, you are working with someone who wants you to make your own specific filter for these EEG cases which you will not easily achieve.

NOTE: In real life, the 50hz/60hz over a 24 hour period is typically good, but from minute to minute, I've seen it drift up and down by as much as 0.2hz.  There have been recorded cases where the line frequency has been off by as much as 1hz or more.
« Last Edit: March 13, 2024, 05:38:47 pm by BrianHG »
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #62 on: March 13, 2024, 05:34:04 pm »
I just ran EDFbrowser for first time and loaded it up but I can't find how to run the Amplitude FFT done by Karel. where to find it.

To view the powerspectrum of a signal, leftclick on the signallabel and choose "Spectrum".

https://www.teuniz.net/edfbrowser/EDFbrowser%20manual.html#Powerspectrum

You had better tell him how to "leftclick", before he asks us.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7742
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #63 on: March 13, 2024, 06:06:59 pm »
What you really need is to sample all the EEG channels in parallel.  Then, make an algorithm which subtracts the common noise from all the channels channels together leaving you with the pure EEG signals.  This means you need a 16 channel sampler with 16 channel amp and 16 channel capture software.

Remember, the 60hz/50hz/6.7khz noise will be on all channels, just at slightly different amplitudes and for the high 6.7khz, slightly different phase.  With all that source info, you can negate just the commonalities between channels.  No notch filtering.  This means a filter with no ringing, echo, bounce.  A filter which will also follow power interruptions and surges since the same junk will be present on all channels.  A notch filter may be useful as a selector to zero in on these selective frequencies, but for low frequencies like 60hz, with a 44.1khz sample rate, you will have a huge 65kpoint sample lag to teeth out that narrow band.
« Last Edit: March 13, 2024, 06:09:16 pm by BrianHG »
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #64 on: March 13, 2024, 11:21:54 pm »
Only the 60 Hz noise is powerline.

There is a mystery 78 Hz noise.

The main noise is broadband noise - which looks like noise floor, but by my calculations it is about 100-150 nV/sqrt Hz - much higher than specified noise of the AMP01. It could be noise from the waveform generator.

However, note that BMA-200 specifies 7uV noise - and your recording shows less noise than this.

You could try measuring the noise directly by using a 1 kohm resistor instead of the waveform generator. It would be interesting to have a series of recordings with different waveforms and 1 with just a resistor - all settings left exactly the same.

Edit: this is 30uV in the 2nd BMA instead of 10uV. With both set to 10uV. the noises are identical.

2070365-0

Anyway. Out of curiosity. Have you guys encountered an amplifier that has no obvious damage but the noise just became 20 times worse like from 5nV/sqrt (Hz) to 100 nv/sqrt (Hz)?

What about ADC. Can ADC damaged by ESD etc cause much more noises too and not obvious non-functional state? Because I have another unit, the expensive $16750 g.USBamp used by major R&D centers worldwide. I got it used for $1100. The following are the waveforms. At 10uV, 1000Hz, the waveforms have bad noises which I guess are not powerline noises at all but the noise floor itself? The g.USBamp doesn't have any amplifier, it uses ADC only with +-250mV range. It's noises are Noise level   < 0.4 µV rms 1-30 Hz. Extrapolating it to 1000Hz, I guess the noises would be above 1 uV? Yet the $16750 unit sells so much. I still haven't bought their $4000 software to use it fully so I used their demo software just to test it.

See its specs at

https://www.gtec.at/product/gusbamp-research/

The following are the outputs from USBamp demo (offset is adjusted to 100uV or it can go off the scale). Input all 10uV, 50Hz from the Netech simulator

The following with 100Hz bandwidth in the USBamp app with Notch Filter off:

2070359-1

The following with 100Hz bandwidth in the USBamp app with Notch Filter on:

2070293-2

The following with 250Hz bandwidth in the USBamp app with Notch Filter off:

2070299-3

The following with 250Hz bandwidth in the USBamp app with Notch Filter on:

2070305-4

The following with 500Hz bandwidth in the USBamp app with Notch Filter off:

2070311-5

The following with 500Hz bandwidth in the USBamp app with Notch Filter on:

2070317-6

The following with 1000Hz bandwidth in the USBamp app with Notch Filter off:

2070323-7

The following with 1000Hz bandwidth in the USBamp app with Notch Filter on:

2070329-8


« Last Edit: March 14, 2024, 10:19:59 am by loop123 »
 

Offline Andy Chee

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: au
Re: FFT and 60 Notch filter software
« Reply #65 on: March 14, 2024, 09:46:18 am »
Assuming your equipment is portable and battery powered, how about going into the middle of a nature park reserve, which is a long distance away from any powerlines, TVs, power supplies, and any other electrical equipment.

You should be able to at least establish the noise floor performance of your equipment.  My suggestion is at least 1000m distance in all directions from any electrical device, but I don't know whether you have a location that size.

This is for testing your equipment only, I'm not suggesting you perform your actual experiments in the middle of nowhere!
 
The following users thanked this post: loop123

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #66 on: March 14, 2024, 10:16:08 am »
Only the 60 Hz noise is powerline.

There is a mystery 78 Hz noise.

The main noise is broadband noise - which looks like noise floor, but by my calculations it is about 100-150 nV/sqrt Hz - much higher than specified noise of the AMP01. It could be noise from the waveform generator.

However, note that BMA-200 specifies 7uV noise - and your recording shows less noise than this.

You could try measuring the noise directly by using a 1 kohm resistor instead of the waveform generator. It would be interesting to have a series of recordings with different waveforms and 1 with just a resistor - all settings left exactly the same.

Bad news. I made mistake in my last test. I rechecked the amplitude and found out I used 30uV in 2nd BMA instead of 10uV that is why there was minimal noise compared to the 10uV waveform in the first BMA. So ignore my last message except the g.USBamp waveforms.

Anyway. I used 1k ohm resistor as you asked in the original BMA. This is the noise with 1kohm resistor alone connected to BMA with 50000 gain 1000Hz banwidth:

2071400-0

This is 10uV 50Hz from the Netech simulator connected to BMA with 50000 gain 1000Hz bandwidth.

2071406-1

Same setting for both only the resistor was replaced to the Netech as you asked.

computing for the resistor noise at 1k ohm and 1000 Hz

0.13*sqrt(R*f) nV (rms) noise = 0.13 sqrt (1000 x 1000 Hz) nv = 0.13 x 1000 = 130nV rms

the noise of the AMP01 is 5nv/sqrt (Hz) x sqrt (1000Hz bandwidth) = 158.11nV rms

combination is sqrt (130^2 + 158.11^2) = sqrt (16900 + 24999) = sqrt (41899) = 204nV rms

In the Audacity, the noise is not 204nV rms!

with 10uV x 50000 = 0.5V.. the noise is not far from 0.5V.. maybe 100 uV. What's going on? The 1kohm resistor test used the same scale as the 10uV and the noises are closed.

They are the noise floor, isn't it? and not interference.. because for interference, you are supposed to be able to filter it using 60Hz and harmonics. and not wide band noise, right?

With the AMP01 5nV/sqrt (Hz). Why are we getting more than say 1000nV/sqrt (Hz) in the BMA? Even if the BMA is so junk, why is the AMP01 also messed up as well. The 2nd BMA showed the same noise so it is not due to defective AMP01
« Last Edit: March 14, 2024, 10:34:04 am by loop123 »
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #67 on: March 14, 2024, 10:37:43 am »
2071412-0

By using 2.5mV in the Netech Simulator and 2000 gain in the BMA. I get 5 volts in Audacity from 1 to -1. 

Does it mean Audacity 1 to -1 is really 5 Volts? Or does it change depending on your setups? how?

So the 10uV x 50000 gain = 0.5V in last message is right scale at it is 0.1 instead of 1  or 5V/10 =0.5V.

 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #68 on: March 14, 2024, 10:51:46 am »
Does it mean Audacity 1 to -1 is really 5 Volts? Or does it change depending on your setups? how?

Sigh. You really don't understand.

Audacity processes numbers, either floating point or integer. Those numbers have absolutely no defined relationship to any input voltage.

Sometimes those numbers might originate in an ADC. Often they will have been "artificially generated" inside a computer program.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1182
  • Country: de
Re: FFT and 60 Notch filter software
« Reply #69 on: March 14, 2024, 11:08:13 am »
Does it mean Audacity 1 to -1 is really 5 Volts? Or does it change depending on your setups? how?

Sigh. You really don't understand.

Audacity processes numbers, either floating point or integer. Those numbers have absolutely no defined relationship to any input voltage.

Sometimes those numbers might originate in an ADC. Often they will have been "artificially generated" inside a computer program.

Exactly.

ffmpeg -i netech\ 10uv\ 50hz\ bma\ 1000hz\ 50000\ gain.wav
...
Input #0, wav, from 'netech 10uv 50hz bma 1000hz 50000 gain.wav':
  Duration: 00:00:29.94, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels, s16, 705 kb/s


The file contains just a stream of signed 16-bit integer numbers whose full-scale range is mapped by Audacity to a -1...+1 range when it loads the file. Either the creator of the file can tell you the codes per Volt in the file, or you need to find out yourself.
 
The following users thanked this post: loop123

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #70 on: March 14, 2024, 12:26:06 pm »
Does it mean Audacity 1 to -1 is really 5 Volts? Or does it change depending on your setups? how?

Sigh. You really don't understand.

Audacity processes numbers, either floating point or integer. Those numbers have absolutely no defined relationship to any input voltage.

Sometimes those numbers might originate in an ADC. Often they will have been "artificially generated" inside a computer program.

Exactly.

ffmpeg -i netech\ 10uv\ 50hz\ bma\ 1000hz\ 50000\ gain.wav
...
Input #0, wav, from 'netech 10uv 50hz bma 1000hz 50000 gain.wav':
  Duration: 00:00:29.94, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels, s16, 705 kb/s


The file contains just a stream of signed 16-bit integer numbers whose full-scale range is mapped by Audacity to a -1...+1 range when it loads the file. Either the creator of the file can tell you the codes per Volt in the file, or you need to find out yourself.


If I used the same ADC and amplifier like the BMA + E1DA. The output at Audacity is consistent? For example using my 5V full scale 1 to -1 baseline in my last message. Can you tell what is the approximate voltage level of the following?   

2071484-0

I really thought it was 10uV and displaying right at the 2nd BMA. But half day later. I can't get the same waveforms. So I assumed it was 30uV.    Based on my 5V baseline using the same BMA + E1DA. Do you think it's 10uV or 30uV?

With the AMP01 noise of 5nv/sqrt (Hz). I should be getting 0.158uV rms noise. And using 10uV signal. There should be no wide band noise like the ones I shared previously.

Andy suggested I go far away to test it. But then with no specific frequencies like 60Hz and harmonics. It is not interference, right? You can already tell from the analysis that the wideband noise is not interference but the noise floor already. Or can interference mimic for all intent and purposes the noise floor such that you can't differentiate noise floor from interference? Please elaborate. Thanks.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #71 on: March 14, 2024, 12:43:01 pm »
Does it mean Audacity 1 to -1 is really 5 Volts? Or does it change depending on your setups? how?

Sigh. You really don't understand.

Audacity processes numbers, either floating point or integer. Those numbers have absolutely no defined relationship to any input voltage.

Sometimes those numbers might originate in an ADC. Often they will have been "artificially generated" inside a computer program.

Exactly.

ffmpeg -i netech\ 10uv\ 50hz\ bma\ 1000hz\ 50000\ gain.wav
...
Input #0, wav, from 'netech 10uv 50hz bma 1000hz 50000 gain.wav':
  Duration: 00:00:29.94, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels, s16, 705 kb/s


The file contains just a stream of signed 16-bit integer numbers whose full-scale range is mapped by Audacity to a -1...+1 range when it loads the file. Either the creator of the file can tell you the codes per Volt in the file, or you need to find out yourself.


If I used the same ADC and amplifier like the BMA + E1DA. The output at Audacity is consistent? For example using my 5V full scale 1 to -1 baseline in my last message. Can you tell what is the approximate voltage level of the following?   

Read the preceding two messages in your message. Please. Pretty please. Think about what they say.

If you don't come to understand why we can't tell you the "approximate voltage level", then there's little anybody can do to help you.

Yes that requires hard work on your part. We've had to go through that process, and so will you.

Alternatively, get out your meter and simply measure the bloody input voltage!
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #72 on: March 14, 2024, 08:13:48 pm »
I have thought and tested a lot what you mentioned. I really can estimate approximate voltage level in my files. Here is why.

In my BMA + E1DA, 5V corresponds to 1 to -1. If I adjusted the amplitudes or the gain, the amplitudes can decrease proportionally. This is also why your audio or music can sound as it is because Audacity can consistently track the amplitudes that is why your wave files don't suddenly have jumping amplitudes that don't corresponds to original recording.

Not only that. But if I save the Audacity file into WAV. And later retrieve. It still shows the same amplitude. Therefore I can estimate approximate voltage level because I know the baseline in my particular equipment. Although you can't estimate the approximate level because you don't know my baseline. Yes. I have from start read gf punchline "The file contains just a stream of signed 16-bit integer numbers whose full-scale range is mapped by Audacity to a -1...+1 range when it loads the file.". I know my full range to be 5V so I can estimate my voltage level. But you can't estimate my voltage level becauase you don't know what voltage corresponds to my full range during the mapping of Audacity of the full range in the stream of signed 16-bit integers as gf put it to 1 to -1. Do you guys agree here? Or do you emphasize even I can't estimate my own voltage level in my own file where I know the full range corresponds to 5V??
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 657
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #73 on: March 14, 2024, 09:46:34 pm »
The point being made is that a WAV file has no concept whatever of what a voltage is. It's just a table of numbers. Those numbers are 0 through 2^n-1 e.g. 0-65535; the +/-1 is just Audacity normalising.

The ONLY part of your system that can correlate the information in your WAV file to actual voltages in the real world is your ADC. Fine, if you're 100% confident that your ADC maps to a peak of 5V (is that 5V pk-pk or 5V RMS?) then yes you can use it to work out voltages.

I assume tha ADC is intended for audio. Does it have any form of automatic gain control or clipping protection? If it does you can forget using it for measurements - sell it and buy a scope instead.
 
The following users thanked this post: loop123

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #74 on: March 14, 2024, 11:19:02 pm »
The point being made is that a WAV file has no concept whatever of what a voltage is. It's just a table of numbers. Those numbers are 0 through 2^n-1 e.g. 0-65535; the +/-1 is just Audacity normalising.

The ONLY part of your system that can correlate the information in your WAV file to actual voltages in the real world is your ADC. Fine, if you're 100% confident that your ADC maps to a peak of 5V (is that 5V pk-pk or 5V RMS?) then yes you can use it to work out voltages.

I assume tha ADC is intended for audio. Does it have any form of automatic gain control or clipping protection? If it does you can forget using it for measurements - sell it and buy a scope instead.

I'll ask Ivan about the E1DA. So when I told "gf" my full range is 5V, and asked him to estimate the voltage level of a lower amplitude waveform then he should be able to do it since I gave the 5V baseline for the 1 to -1. The reason I need to estimate is because when I used the 2nd backup BMA initially. I got what I thought was a 10uV with BMA 1000Hz switch with no noise. but I couldn't repeat it. Instead I always got the same noise as the one I shared early which some of you made frequency analysis with unknown 78Hz peak. The following is the 5V reference waveform to 1 to -1, the 10uV with 100Hz selected (here I can't duplicate it so gf, Karel, WatchfulEye, please run the Wav file attached and let me know how to duplicate the dancing waveforms).. In the third image is the one I thought was 10uV with 1000Hz bandwidth with no noise, but the amplitude is much larger so I was wondering if it is really 30uV instead of 10uV. Hence asking gf to verify the voltage level with the 1 to -1 referenced to 5 Volts (I am sure) given.

2072591-0

2072597-1

2072603-2

gf. please check if the last image above has the same amplitude as the middle image with confirmed 10uV or is the last image not 10uV? If so, then it is 30uV and the noises in the earlier image I shown which you made frequency analysis is correct. If so, my next goal is figuring out how a AMP01 with excellent 5nV/sqrt (Hz) noise figure turn to 1000nV/sqrt (Hz) noise figure in the BMA and build a virgin AMP01 that can do 10uV with 0.158uV noise.

 
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19511
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: FFT and 60 Notch filter software
« Reply #75 on: March 14, 2024, 11:48:40 pm »
It is always good to check and verify your understanding by experiment.

You can do this yourself...

Apply a since wave signal to the input, and monitor how that appears in your .wav file and audacity.

Tweak the amplitude until the magnitude is full scale peak to peak without clipping.

Measure the input signal, not forgetting the standard RMS to peak-peak conversion.R

Sanity check: reduce the input signal by a factor of 10, and verify the numbers seen in audacity match that.

Summary: do the bloody experiment yourself, and stop asking us to guess about your setup.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #76 on: March 15, 2024, 12:57:07 am »
It is always good to check and verify your understanding by experiment.

You can do this yourself...

Apply a since wave signal to the input, and monitor how that appears in your .wav file and audacity.

Tweak the amplitude until the magnitude is full scale peak to peak without clipping.

Measure the input signal, not forgetting the standard RMS to peak-peak conversion.R

Sanity check: reduce the input signal by a factor of 10, and verify the numbers seen in audacity match that.

Summary: do the bloody experiment yourself, and stop asking us to guess about your setup.

Did it. The error is 0.001  or about 0.1%.. from   0.926 (5V)  to 0.0922 (0.5V).   

Why, does other ADC or typical sound card show more error? The E1DA was marketed to measure distortions (not for general playing music) so it is super accurate. And their technical team said it hasn't got any form of automatic gain control or clipping protection.

Super accurate $800 Netech 2.5mV output and BMA set to 2000 gain for 5V.

2072861-0

Super accurate $800 Netech 2.5mV output and BMA set to 200 gain for 0.5V.


2072867-1
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #77 on: March 15, 2024, 02:07:11 am »
Assuming your equipment is portable and battery powered, how about going into the middle of a nature park reserve, which is a long distance away from any powerlines, TVs, power supplies, and any other electrical equipment.

You should be able to at least establish the noise floor performance of your equipment.  My suggestion is at least 1000m distance in all directions from any electrical device, but I don't know whether you have a location that size.

This is for testing your equipment only, I'm not suggesting you perform your actual experiments in the middle of nowhere!

Everytime there is interference, some frequencies can be determined, right? In the case of my 10uV input and 1000 bandwidth switched selected in the amp. Many here concluded it is wideband noise or already the noise floor. So it can't be interference. Well before I try to spend days going to the mountain in the middle of nowhere. I need first to figure out how a 5nV/sqrt (Hz) in the AMP01 becomes 1000nV/sqrt (Hz).   Because at 5nV/sqrt(Hz) and with bandwidth of 1000Hz, the noise is only 0.158uV and 10uV signal should look very good. How the AMP01 in the BMA-200 get noise of 2uV at 1000Hz (instead of 0.158uV) is a big mystery I'm trying to figure out. Any ideas guys? Have you encountered any amplifier with noise over 1000 worse than in datasheet? The broadband noise or even noise floor has no particular frequencies so many here concluded they are not interferences.
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #78 on: March 15, 2024, 02:33:58 am »
Only the 60 Hz noise is powerline.

There is a mystery 78 Hz noise.

The main noise is broadband noise - which looks like noise floor, but by my calculations it is about 100-150 nV/sqrt Hz - much higher than specified noise of the AMP01. It could be noise from the waveform generator.

However, note that BMA-200 specifies 7uV noise - and your recording shows less noise than this.

You could try measuring the noise directly by using a 1 kohm resistor instead of the waveform generator. It would be interesting to have a series of recordings with different waveforms and 1 with just a resistor - all settings left exactly the same.

The BMA-200 has this noise spec "Wideband noise, RTI  <7µV P-P". I figured the wideband noise has full 50kHz selected so for the AMP01 5nV/sqrt(Hz) * sqrt (50000) = 1118nV rms or 7000nV P-P. I know Referred to input means the output is measured that includes all the components including the ADC noise. But still.. 1118nV is good estimate for noise at 50000Hz. But for noise at 1000Hz. It is only 0.158uV rms. So where do you think the 100-150nV/Sqrt (Hz) broadband noise came from in the 10uV signal? You asked me to use 1 k Ohm resistor. I did it and here is the result:

1k resistor, all same setting

2072987-0

10uV, 50Hz all same setting

2072993-1

So the broadband noises don't come from the Netech simulator because the resistor also made those noises. So what do you think is the origin of the broadband noise at your estimated 100-150nV/Sqrt (Hz)? I have 2 units BMA and it can't be both AMP01 were damaged. Or maybe they are? What is your other theory WatchfulEye?  I am clueless now. Thanks.
« Last Edit: March 15, 2024, 02:36:19 am by loop123 »
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #79 on: March 15, 2024, 07:32:45 am »

I decide to initiate bypass operation to tap directly into the +IN and -IN of the AMP01. I will cut into some part of the pcb. I have 2 sets and one will be sacrifice. Each costs $1595 so don't want to destroy much. So to tap into the +IN and -IN, i'll directly connect the Netech output into them without using any other components? Because I think somewhere en route to it is the source of the broadband noise analyzed by some of you.

BMA front and back (xray mode)

2073203-0

2073209-1
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 657
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #80 on: March 15, 2024, 11:18:18 am »
Did it. The error is 0.001  or about 0.1%.. from   0.926 (5V)  to 0.0922 (0.5V).   

Why, does other ADC or typical sound card show more error? The E1DA was marketed to measure distortions (not for general playing music) so it is super accurate. And their technical team said it hasn't got any form of automatic gain control or clipping protection.

It might be super-high resoludion and linearity, but that's not the same as accuracy.

I can't see any refernce to it above, but have you tried terminating the ADC input to characterise its noise? If you don't know the characteristics of your measuring device then everything else is academic.

Out of interest are you making differential measurements all along the line, or are you feeding single-ended inputs into the diff amp somehow?
 

Offline WatchfulEye

  • Regular Contributor
  • *
  • Posts: 110
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #81 on: March 15, 2024, 11:55:31 am »
So the broadband noises don't come from the Netech simulator because the resistor also made those noises. So what do you think is the origin of the broadband noise at your estimated 100-150nV/Sqrt (Hz)? I have 2 units BMA and it can't be both AMP01 were damaged. Or maybe they are? What is your other theory WatchfulEye?  I am clueless now. Thanks.

Well it must be the measurement setup somewhere. The most likely point is the input the amplifier. I've looked at some of the photos again, and it looks like there is an additional amplifier or head stage before the BMA? What is that? If it is before the BMA, then it will be contributing to noise, potentially more than the BMA.

Isolated amplifiers may sacrifice noise and bandwidth performance in order to achieve isolation.
 

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #82 on: March 15, 2024, 02:39:23 pm »
So the broadband noises don't come from the Netech simulator because the resistor also made those noises. So what do you think is the origin of the broadband noise at your estimated 100-150nV/Sqrt (Hz)? I have 2 units BMA and it can't be both AMP01 were damaged. Or maybe they are? What is your other theory WatchfulEye?  I am clueless now. Thanks.

Well it must be the measurement setup somewhere. The most likely point is the input the amplifier. I've looked at some of the photos again, and it looks like there is an additional amplifier or head stage before the BMA? What is that? If it is before the BMA, then it will be contributing to noise, potentially more than the BMA.

Isolated amplifiers may sacrifice noise and bandwidth performance in order to achieve isolation.

The small box is just empty (see below). It used to be the chassis of the ISO122 isolator but I found out at 1mV and 1000Hz and above, it has ripple noises and we traced it to the ISO122. So I removed the isolator pcb and just used the chassis as connector box for the 1.5mm touchproof sockets.

2073869-0

The Netech has differential outputs. I'm still asking the designer if his E1DA ADC could cause the noises and asking about the inputs shorted way of testing noises.

2073875-1

In the BMA. I traced the following and found out it has clamping protection, and the inputs didn't go directly to the AMP01. Instead it goes to the LF412CP CHIP (the left is 1In-, 1In+) and detours elsewhere before going to the AMP01. Can I just bypass the inputs directly to the AMP01? I plan to remove the chip, and put another empty socket with the +IN, -IN not connected to the pcb but instead directly to Netech, this would work?  I don't want to damage the board irreversibly because I plan to use the 2 pcs of BMA for 2 channels.

2073881-2
« Last Edit: March 15, 2024, 02:43:54 pm by loop123 »
 

Offline WatchfulEye

  • Regular Contributor
  • *
  • Posts: 110
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #83 on: March 15, 2024, 03:48:57 pm »
Can you provide wav files for the resistor and new measurements. The files I had have very low signal - looks like gain was set wrong, and this may cause errors in the noise calculation (the wrong gain setting may mean the ADC/quantisation noise is contributing excessively in the earlier files).

I've looked at the photos of the BMA-200. Looks like the input stage is the LF412C, which conditions the signal before going to the AMP01. The LF412C is quite a low noise op amp, but still a lot higher than the AMP01. There are also a lot of resistors in the signal path, which can also add noise. I can't read the values off the resistors near the LF412C, so don't know if these are contributing much. It might be interesting to know these, to calculate the noise contribution of teh individual components before any modifications are made.
 
The following users thanked this post: loop123

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #84 on: March 15, 2024, 04:39:25 pm »
Can you provide wav files for the resistor and new measurements. The files I had have very low signal - looks like gain was set wrong, and this may cause errors in the noise calculation (the wrong gain setting may mean the ADC/quantisation noise is contributing excessively in the earlier files).

I've looked at the photos of the BMA-200. Looks like the input stage is the LF412C, which conditions the signal before going to the AMP01. The LF412C is quite a low noise op amp, but still a lot higher than the AMP01. There are also a lot of resistors in the signal path, which can also add noise. I can't read the values off the resistors near the LF412C, so don't know if these are contributing much. It might be interesting to know these, to calculate the noise contribution of teh individual components before any modifications are made.

The IN- for example is connected to the blue Bourn variable resistor and many resistors (didn't do complete trace of the portion before because I thought it was not necessary but now there seems no other choice but to do full trace to know the source of the dreaded noise at 10uv 1000Hz up). Here are the front photo without using Inkscape transparent mode.

2074184-0

2074190-1


 

Offline WatchfulEye

  • Regular Contributor
  • *
  • Posts: 110
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #85 on: March 15, 2024, 06:41:14 pm »
I've extracted the input conditioning circuit and done a noise simulation using some estimates from some datasheets for the LF412.

The sim shows approx 750 nV rms input referred noise over a 1 kHz bandwidth - but note that there is a separate buffer for both In- and In+ - so the sum is approx 1 uV rms. Using the typical estimate of Vnoise p-p as 6x Vnoise rms - this gives a broadband noise of approx 6 uV p-p - which looks approximately consistent with the supplied files (although I haven't reviewed one with the gains set correctly).

It might be possible to replace the LF412 with a more modern and lower noise op-amp. I haven't checked catalogs. You might be constrained by the DIP package, but you might be able to use an SMD adapter to convert a SOIC dual op amp to DIP.
« Last Edit: March 15, 2024, 06:44:02 pm by WatchfulEye »
 
The following users thanked this post: loop123

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #86 on: March 15, 2024, 08:50:00 pm »
I've extracted the input conditioning circuit and done a noise simulation using some estimates from some datasheets for the LF412.

The sim shows approx 750 nV rms input referred noise over a 1 kHz bandwidth - but note that there is a separate buffer for both In- and In+ - so the sum is approx 1 uV rms. Using the typical estimate of Vnoise p-p as 6x Vnoise rms - this gives a broadband noise of approx 6 uV p-p - which looks approximately consistent with the supplied files (although I haven't reviewed one with the gains set correctly).

It might be possible to replace the LF412 with a more modern and lower noise op-amp. I haven't checked catalogs. You might be constrained by the DIP package, but you might be able to use an SMD adapter to convert a SOIC dual op amp to DIP.

Deja Vu. We have focused on the Iso-Z isolation head in the thread "Can changing amplifier in Sullen-Key filter affect the frequency response much?" last Feb 4. https://www.eevblog.com/forum/beginners/can-changing-amplifier-in-sullen-key-filter-affect-the-frequency-response-much/  my initial message was altering the values used in the LF411CP in the ISO-Z Isolation head box.  Is the LF412 in the BMA another Sallen-key filter?   Near the end of the thread. The solution there was to increase the gain to 100X before going to the ISO122. I tried it, it worked. But I didn't continue using the ISO-Z because I'm using pure batteries in the BMA and people convinced me no galvanic isolation needed. Also, I didn't use it because at microvolts. I'm afraid the dc converter may contribute some noises as well as retained noises even after 100x gain. At that time my target was 1mV. But lowered it to 10uV now. The message of RFDX was the first time he gave figures of the chip (there I learnt to compute noises) where he said.

"The noise spectral density of the ISO122 is 4uV/SQR(Hz) ("Noise" on p.5 of the datasheet). To get the noise voltage (RMS) multiply with SQR(bandwidth-in-Hz). With the bandwidth switched to the max. of 50kHz, the noise voltage at the output would be 0.894mV RMS. That is alot for an input signal of only 1mV (RMS?). With a bandwidth of only 100Hz, the noise voltage is only 40uV RMS. The main amplifier also contributes some noise to the output but it is probably very little in comparison to the ISO-amp and can be ignored.

Fig. 12 in the datasheet shows the unfiltered 20mVpp ripple from the 500kHz clock feedthrough plus the broadband noise from the ISO-amp. Fig. 13 shows only the broadband noise at the output after being filtered by the additional 50kHz Sallen-Key lowpass filter. The 500kHz ripple is gone (buried in noise). The broadband noise has at least 6...7mVpp. Divide this by 6.6 to get the RMS value."

My solution for it was to eliminate the ISO-Z entirely that was why in my 2nd to last message. I showed you picture of the inside of the ISO-Z without the pcb. Going now to the main BMA-200. What if I will just eliminate the LF412C stage. You said "LF412C, which conditions the signal before going to the AMP01". What is the purpose of conditioning it? Why happens if it is not conditioned and the input goes directly to the +IN and -IN of the AMP01? Thanks.
« Last Edit: March 15, 2024, 08:52:14 pm by loop123 »
 

Offline WatchfulEye

  • Regular Contributor
  • *
  • Posts: 110
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #87 on: March 15, 2024, 09:40:16 pm »
The BF412 in the BMA-200 acts as a pre-amplifier with gain of 2 and very high input impedance. It also provides trimming for CMRR and DC offset.  Due to its near infinite input impedance and very low bias current, it has near zero current noise, so is ideal for buffering very high impedance signal sources.

The AMP01 is bipolar input, rather than FET input like the BF412. As such it has higher bias currents and higher current noise, which means that if the impedance of your signal is more than about 200 kOhms, it will likely give more noise than the BF412.

I've downloaded your last wav file, and done some measurements with it. Unfortunately, the netech simulator does not appear to be properly specified, and none of the documentation states what "10 uV" means (rms, VPeak, or Vpeak-peak). In order to do calculations I've just had to assume that the netech is calibated, and by what is meant by amplitude. In my previous calculations I'd assumed rms, but after some consideration, I wonder if it is supposed to be Vp-p.

Anyhow, assuming that it is Vp-p, then I estimate around 60 nV/sqrtHz broadband noise in the 50-100 Hz range, rising below about 50 Hz - which is pretty close to what I simulated for the BF412 input stage.

Some physiological amplifiers specify noise over a band, which can make comparison difficult. For example, one amplifier specifies 0.4 uV rms between 1-30 Hz. This is a fairly average for FET amplifier, and basically equivalent to the BF412 amplifier in the BMA-200 (i.e. this amplifier would provide similar noise to your current system).
« Last Edit: March 15, 2024, 10:19:09 pm by WatchfulEye »
 
The following users thanked this post: loop123

Offline loop123Topic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 297
  • Country: ca
Re: FFT and 60 Notch filter software
« Reply #88 on: March 15, 2024, 11:26:55 pm »
The BF412 in the BMA-200 acts as a pre-amplifier with gain of 2 and very high input impedance. It also provides trimming for CMRR and DC offset.  Due to its near infinite input impedance and very low bias current, it has near zero current noise, so is ideal for buffering very high impedance signal sources.

The AMP01 is bipolar input, rather than FET input like the BF412. As such it has higher bias currents and higher current noise, which means that if the impedance of your signal is more than about 200 kOhms, it will likely give more noise than the BF412.

I've downloaded your last wav file, and done some measurements with it. Unfortunately, the netech simulator does not appear to be properly specified, and none of the documentation states what "10 uV" means (rms, VPeak, or Vpeak-peak). In order to do calculations I've just had to assume that the netech is calibated, and by what is meant by amplitude. In my previous calculations I'd assumed rms, but after some consideration, I wonder if it is supposed to be Vp-p.

Anyhow, assuming that it is Vp-p, then I estimate around 60 nV/sqrtHz broadband noise in the 50-100 Hz range, rising below about 50 Hz - which is pretty close to what I simulated for the BF412 input stage.

Some physiological amplifiers specify noise over a band, which can make comparison difficult. For example, one amplifier specifies 0.4 uV rms between 1-30 Hz. This is a fairly average for FET amplifier, and basically equivalent to the BF412 amplifier in the BMA-200 (i.e. this amplifier would provide similar noise to your current system).

https://www.eevblog.com/forum/projects/instrumentation-amplifier-modification-or-replacement/

If I can't do away without the BF412, then I may need to replace the AMP01 itself. In this above 4 page thread I asked people what is the best replacement. They said the AMP01 5nV/Sqrt(Hz) is difficult to beat. They didn't know it requires the BF412 which can add a lot of noise. Do you know what FET or other amplifiers that can be used that can replace both BF412, AMP01 and doesn't have that broadband noise at 10uV at 1000Hz and higher? It is ok if the pins are not the same as the AMP01.. I can rewire it in the socket. I have 2 pcs of BMA and one can be used as experimental board for the new amp replacement. You can reply in that thread so people who have thought about the replacement can comment on it too. Many thanks.
 

Offline WatchfulEye

  • Regular Contributor
  • *
  • Posts: 110
  • Country: gb
Re: FFT and 60 Notch filter software
« Reply #89 on: March 16, 2024, 12:15:57 am »
I've had a quickj look for some alternatives to the LF412.

You could try something like an OPA2132P, which should be a direct plug in replacement. It has a much lower noise of 8nV/sqrt Hz.

There are lower noise amplifiers but they are things like SOIC packages which will need adapters to be soldered in. You are also limited by the 4.99 kOhm resistors which each contribute 9 nV/sqrt Hz of noise - so once the OPA2132 is in, the resistors will be the biggest noise source.

If you really fancy getting some SOIC-8 to DIP-8 adaptors, then something like an OPA827 could be tried, but it is diminishing returns because of the resistors.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf