does sub aliasing occur?

Thread Starter

Gpand

Joined Dec 11, 2023
105
There is this amplifier which always samples at 38,400Hz. So the Nyquist frequency is 19,200Hz. It has a 5kHz antialising/low pass filter. Now it has a DSP where you can set the software sampling for example 4800Hz. And you could choose bandpass selection of say 5Hz to 1000Hz. I'd like to know if this is common setup. Does this mean the digital Nyquist frequency is 2400Hz. But if it accepts signal in say 3000Hz. With respect to 4800Hz digital sampling. Can 3000Hz cause aliasing with the main sampling always at constant 38,400Hz? What do you call this setup?
 

WBahn

Joined Mar 31, 2012
30,290
I think I understand your description and, if so, the answer is yes. Imaging you had a signal at 4800 Hz and it first passed through a 5 kHz anti-alias filter. Let's assume the skirts were sharp enough such that no significant attenuation occurred (this is almost certainly a bad assumption, but this is also why the end system appears to be intended to not work with signals above 1000 Hz). Now sample this signal at 4800 Hz. You get a DC result because you are sampling at the same point in the waveform at every cycle. That's aliasing. Any signal component greater than 2400 Hz will get aliased, which then begs the question of why the anti-aliasing filter isn't set to 2400 Hz or less.

As for what this "setup" is called -- I'm not even sure what you mean by "setup". But whatever you mean, I doubt there is any term for something so specific.
 

Thread Starter

Gpand

Joined Dec 11, 2023
105
I think I understand your description and, if so, the answer is yes. Imaging you had a signal at 4800 Hz and it first passed through a 5 kHz anti-alias filter. Let's assume the skirts were sharp enough such that no significant attenuation occurred (this is almost certainly a bad assumption, but this is also why the end system appears to be intended to not work with signals above 1000 Hz). Now sample this signal at 4800 Hz. You get a DC result because you are sampling at the same point in the waveform at every cycle. That's aliasing. Any signal component greater than 2400 Hz will get aliased, which then begs the question of why the anti-aliasing filter isn't set to 2400 Hz or less.

As for what this "setup" is called -- I'm not even sure what you mean by "setup". But whatever you mean, I doubt there is any term for something so specific.
The following is the equipment concerned. It costs $17500 so wondering how they didn't take care of any aliasing if indeed there is. First a bit of description. See the web site for more specs.

g.USBAMP RESEARCH | EEG/Biosignal Amplifier | g.tec medical engineering GmbH medical engineering (gtec.at)

"ACCURACY AND DATA QUALITY

Each of the 16 analog to digital converters operates at 2.4576 MHz. Oversampling 64 times yields the internal sampling rate of 38,400 Hz (per channel and for all channels!). In addition, a powerful floating point Digital Signal Processor performs oversampling and real-time filtering of the biosignal data (between 0 Hz – 2,400 Hz). Therefore, a typical sampling frequency of 256 Hz yields an oversampling rate of 9,600. This results in a very high signal to noise ratio."

It uses the BCI2000 software which I'm using which has this description:

User Reference:gUSBampADC - BCI2000 Wiki

"FilterEnabled
Choose 1 if you want a pass band filter, and 0 if you don't. The gUSBamp is a DC amplifier and thus you most likely will want a pass band filter. Please note that, because the g.USBamp internally has a 5kHz antialiasing filter and always samples with 38.4kHz, you DO NOT need to enable any filter if you do not want. You will never experience aliasing."

What does it mean you will never experience aliasing because it always samples at 38.4kHz?

I choose 4800Hz sampling, LP of 1000Hz and HP of 5Hz in the setting and wonder what the above mean no aliasing can occur (there is the 64X oversampling which can perhaps take care of it??. Kindly explain. Thanks.
 
Last edited:

Thread Starter

Gpand

Joined Dec 11, 2023
105
Wait. The g.USBamp described above has no analog front end. Its directly ADC so the 4800Hz sampling amidst higher 38.4kHz and even amidst higher 2.45Mhz is digital sampling. Not analog frontend. So can digital sampling also have digital Nyquist frequency and digital aliasing? Remember this actual case differs to the one with analog front end.
 

Thread Starter

Gpand

Joined Dec 11, 2023
105
I forgot to mention something. The equipment has a software low pass filter too. So with 38.4kHz ADC over sampling, 4800Hz digital sampling, 1000Hz digital low pass filter, there would be no aliasing above 2400Hz right? The g.USBamp is used by thousands of institutations even if it costs $17500. I saw the following page where it was mentioned "A g.USBamp biosingal amplifier (Guger Technologies) was used for all biosignal amplification, acquisition (512Hz sampling frequeny), notch filtering (60Hz) and anti-aliasing (pass band 0.1-100Hz). " So any digital low pass filter available can remove the aliasing, right? So would you say it is still there?

A BRAIN-COMPUTER INTERFACE FOR CLOSED-LOOP SENSORY STIMULATION DURING MOTOR TRAINING IN PATIENTS WITH TETRAPLEGIA (uky.edu)

alias passband.jpg
 

WBahn

Joined Mar 31, 2012
30,290
Aliasing can't be eliminated digitally.

It sounds like this system, based on what I'm seeing here, has an analog antialiasing filter with a cutoff frequency of 5 kHz before it gets sampled at 38.4 kSa/s. You now have a stream of digital samples that contain no appreciable content much above 5 kHz. If you then want to sub-sample that at 4800 Sa/s, you risk aliasing, but you can apply a digital low pass filter to the data stream to remove the content that is above 2400 Hz before doing so.
 

Thread Starter

Gpand

Joined Dec 11, 2023
105
Aliasing can't be eliminated digitally.

It sounds like this system, based on what I'm seeing here, has an analog antialiasing filter with a cutoff frequency of 5 kHz before it gets sampled at 38.4 kSa/s. You now have a stream of digital samples that contain no appreciable content much above 5 kHz. If you then want to sub-sample that at 4800 Sa/s, you risk aliasing, but you can apply a digital low pass filter to the data stream to remove the content that is above 2400 Hz before doing so.
Sub-sample is same meaning as oversamplng? I read this in the net when I tried to google "adc oversampling low pass aliasing":

"The oversampling consists of sampling the analog input signal at higher rates than the Nyquist frequency limit, filtering the samples, and reducing the sample rate by decimation. Using this method relaxes the antialiasing low-pass filter constraints."

The g.USBamp does oversampling using not just 38400 but also another 64 times to 2.4576 MHz. So how does this trick eliminate signal getting into between 2400Hz and 5kHz and avoid aliasing if the sub sampling is 4800Hz? What is another term for sub-sampling?
 

WBahn

Joined Mar 31, 2012
30,290
I may not be using the right, or at least the most common current, terminology. I haven't done much with this stuff for nearly four decades. Decimation is probably the better term (though, strictly speaking, decimation means taking every tenth item, but it's always been understood to be have more general meaning than that).

It looks like the signal is initially sampled at the 2.4576 MSa/s rate (not the 38.4 kSa/s you initially mentioned). This is then reduced to 38.4 kSa/s by averaging 64 samples of input for each sample of output. Doing this improves the signal-to-noise ratio by about a factor of 8, since the correlated signal goes up by a factor of 64 while the uncorrelated noise only goes up by a factor of 8. Because the signal is being initially sampled way above the 5 kHz anti-aliasing filter, it does not have to have steep skirts, and hence is much easier to implement. Further antialiasing filtering needed to reduce the sample rate further can be done digitally. If this is done by averaging signals (instead of just taking every nth sample), the SNR can be improved by another factor of sqrt(n).
 

Thread Starter

Gpand

Joined Dec 11, 2023
105
I may not be using the right, or at least the most common current, terminology. I haven't done much with this stuff for nearly four decades. Decimation is probably the better term (though, strictly speaking, decimation means taking every tenth item, but it's always been understood to be have more general meaning than that).

It looks like the signal is initially sampled at the 2.4576 MSa/s rate (not the 38.4 kSa/s you initially mentioned). This is then reduced to 38.4 kSa/s by averaging 64 samples of input for each sample of output. Doing this improves the signal-to-noise ratio by about a factor of 8, since the correlated signal goes up by a factor of 64 while the uncorrelated noise only goes up by a factor of 8. Because the signal is being initially sampled way above the 5 kHz anti-aliasing filter, it does not have to have steep skirts, and hence is much easier to implement. Further antialiasing filtering needed to reduce the sample rate further can be done digitally. If this is done by averaging signals (instead of just taking every nth sample), the SNR can be improved by another factor of sqrt(n).
So when i was doing the 4800Hz sampling with bandpass of 5Hz to 1000Hz in the DSP. It's like doing this at software after the ADC acquires the signal? So how many percentage is the aliasing attenuated between 2400Hz and 5000hz using the 4800Hz DSP or software sampling? Can it equal just putting 4800Hz low pass filter before the ADC? it doesn't do this because tthere are many choices in the sampling and bandpass specifically:

sfr means sampling frequency, or is the Butterworth filter order

*******************************************
BCI2000 Information Tool for g.USBamp
*******************************************
(C)2004 Gerwin Schalk
Wadsworth Center
New York State Department of Health
Albany, NY, USA
*******************************************
Amp found at USB address 1 (S/N: UA-200X.XX.XX)
Printing info for first amp (USB address 1)

Available bandpass filters
===================================
num| hpfr | lpfreq | sfr | or | type
===================================
000| 0.10 | 0.0 | 32 | 8 | 1
001| 1.00 | 0.0 | 32 | 8 | 1
002| 2.00 | 0.0 | 32 | 8 | 1
003| 5.00 | 0.0 | 32 | 8 | 1
004| 0.00 | 15.0 | 32 | 8 | 1
005| 0.01 | 15.0 | 32 | 8 | 1
006| 0.10 | 15.0 | 32 | 8 | 1
007| 0.50 | 15.0 | 32 | 8 | 1
008| 2.00 | 15.0 | 32 | 8 | 1
009| 0.10 | 0.0 | 64 | 8 | 1
010| 1.00 | 0.0 | 64 | 8 | 1
011| 2.00 | 0.0 | 64 | 8 | 1
012| 5.00 | 0.0 | 64 | 8 | 1
013| 0.00 | 30.0 | 64 | 8 | 1
014| 0.01 | 30.0 | 64 | 8 | 1
015| 0.10 | 30.0 | 64 | 8 | 1
016| 0.50 | 30.0 | 64 | 8 | 1
017| 2.00 | 30.0 | 64 | 8 | 1
018| 0.10 | 0.0 | 128 | 8 | 1
019| 1.00 | 0.0 | 128 | 8 | 1
020| 2.00 | 0.0 | 128 | 8 | 1
021| 5.00 | 0.0 | 128 | 8 | 1
022| 0.00 | 30.0 | 128 | 8 | 1
023| 0.00 | 60.0 | 128 | 8 | 1
024| 0.01 | 30.0 | 128 | 8 | 1
025| 0.01 | 60.0 | 128 | 8 | 1
026| 0.10 | 30.0 | 128 | 8 | 1
027| 0.10 | 60.0 | 128 | 8 | 1
028| 0.50 | 30.0 | 128 | 8 | 1
029| 0.50 | 60.0 | 128 | 8 | 1
030| 2.00 | 30.0 | 128 | 8 | 1
031| 2.00 | 60.0 | 128 | 8 | 1
032| 0.10 | 0.0 | 256 | 8 | 1
033| 1.00 | 0.0 | 256 | 8 | 1
034| 2.00 | 0.0 | 256 | 8 | 1
035| 5.00 | 0.0 | 256 | 8 | 1
036| 0.00 | 30.0 | 256 | 8 | 1
037| 0.00 | 60.0 | 256 | 8 | 1
038| 0.00 | 100.0 | 256 | 8 | 1
039| 0.01 | 30.0 | 256 | 6 | 1
040| 0.01 | 60.0 | 256 | 8 | 1
041| 0.01 | 100.0 | 256 | 8 | 1
042| 0.10 | 30.0 | 256 | 8 | 1
043| 0.10 | 60.0 | 256 | 8 | 1
044| 0.10 | 100.0 | 256 | 8 | 1
045| 0.50 | 30.0 | 256 | 8 | 1
046| 0.50 | 60.0 | 256 | 8 | 1
047| 0.50 | 100.0 | 256 | 8 | 1
048| 2.00 | 30.0 | 256 | 8 | 1
049| 2.00 | 60.0 | 256 | 8 | 1
050| 2.00 | 100.0 | 256 | 8 | 1
051| 5.00 | 30.0 | 256 | 8 | 1
052| 5.00 | 60.0 | 256 | 8 | 1
053| 5.00 | 100.0 | 256 | 8 | 1
054| 0.10 | 0.0 | 512 | 8 | 1
055| 1.00 | 0.0 | 512 | 8 | 1
056| 2.00 | 0.0 | 512 | 8 | 1
057| 5.00 | 0.0 | 512 | 8 | 1
058| 0.00 | 30.0 | 512 | 8 | 1
059| 0.00 | 60.0 | 512 | 8 | 1
060| 0.00 | 100.0 | 512 | 8 | 1
061| 0.00 | 200.0 | 512 | 8 | 1
062| 0.01 | 30.0 | 512 | 6 | 1
063| 0.01 | 60.0 | 512 | 6 | 1
064| 0.01 | 100.0 | 512 | 6 | 1
065| 0.01 | 200.0 | 512 | 8 | 1
066| 0.10 | 30.0 | 512 | 8 | 1
067| 0.10 | 60.0 | 512 | 8 | 1
068| 0.10 | 100.0 | 512 | 8 | 1
069| 0.10 | 200.0 | 512 | 8 | 1
070| 0.50 | 30.0 | 512 | 8 | 1
071| 0.50 | 60.0 | 512 | 8 | 1
072| 0.50 | 100.0 | 512 | 8 | 1
073| 0.50 | 200.0 | 512 | 8 | 1
074| 2.00 | 30.0 | 512 | 8 | 1
075| 2.00 | 60.0 | 512 | 8 | 1
076| 2.00 | 100.0 | 512 | 8 | 1
077| 2.00 | 200.0 | 512 | 8 | 1
078| 5.00 | 30.0 | 512 | 8 | 1
079| 5.00 | 60.0 | 512 | 8 | 1
080| 5.00 | 100.0 | 512 | 8 | 1
081| 5.00 | 200.0 | 512 | 8 | 1
082| 0.10 | 0.0 | 600 | 8 | 1
083| 1.00 | 0.0 | 600 | 8 | 1
084| 2.00 | 0.0 | 600 | 8 | 1
085| 5.00 | 0.0 | 600 | 8 | 1
086| 0.00 | 30.0 | 600 | 8 | 1
087| 0.00 | 60.0 | 600 | 8 | 1
088| 0.00 | 100.0 | 600 | 8 | 1
089| 0.00 | 200.0 | 600 | 8 | 1
090| 0.00 | 250.0 | 600 | 8 | 1
091| 0.01 | 60.0 | 600 | 6 | 1
092| 0.01 | 100.0 | 600 | 6 | 1
093| 0.01 | 200.0 | 600 | 6 | 1
094| 0.01 | 250.0 | 600 | 8 | 1
095| 0.10 | 60.0 | 600 | 8 | 1
096| 0.10 | 100.0 | 600 | 8 | 1
097| 0.10 | 200.0 | 600 | 8 | 1
098| 0.10 | 250.0 | 600 | 8 | 1
099| 0.50 | 30.0 | 600 | 8 | 1
100| 0.50 | 60.0 | 600 | 8 | 1
101| 0.50 | 100.0 | 600 | 8 | 1
102| 0.50 | 200.0 | 600 | 8 | 1
103| 0.50 | 250.0 | 600 | 8 | 1
104| 2.00 | 30.0 | 600 | 8 | 1
105| 2.00 | 60.0 | 600 | 8 | 1
106| 2.00 | 100.0 | 600 | 8 | 1
107| 2.00 | 200.0 | 600 | 8 | 1
108| 2.00 | 250.0 | 600 | 8 | 1
109| 5.00 | 30.0 | 600 | 8 | 1
110| 5.00 | 60.0 | 600 | 8 | 1
111| 5.00 | 100.0 | 600 | 8 | 1
112| 5.00 | 200.0 | 600 | 8 | 1
113| 5.00 | 250.0 | 600 | 8 | 1
114| 0.10 | 0.0 | 1200 | 8 | 1
115| 1.00 | 0.0 | 1200 | 8 | 1
116| 2.00 | 0.0 | 1200 | 8 | 1
117| 5.00 | 0.0 | 1200 | 8 | 1
118| 0.00 | 30.0 | 1200 | 8 | 1
119| 0.00 | 60.0 | 1200 | 8 | 1
120| 0.00 | 100.0 | 1200 | 8 | 1
121| 0.00 | 200.0 | 1200 | 8 | 1
122| 0.00 | 250.0 | 1200 | 8 | 1
123| 0.00 | 500.0 | 1200 | 8 | 1
124| 0.01 | 100.0 | 1200 | 6 | 1
125| 0.01 | 200.0 | 1200 | 6 | 1
126| 0.01 | 250.0 | 1200 | 6 | 1
127| 0.01 | 500.0 | 1200 | 6 | 1
128| 0.10 | 100.0 | 1200 | 6 | 1
129| 0.10 | 200.0 | 1200 | 8 | 1
130| 0.10 | 250.0 | 1200 | 8 | 1
131| 0.10 | 500.0 | 1200 | 8 | 1
132| 0.50 | 100.0 | 1200 | 8 | 1
133| 0.50 | 200.0 | 1200 | 8 | 1
134| 0.50 | 250.0 | 1200 | 8 | 1
135| 0.50 | 500.0 | 1200 | 8 | 1
136| 2.00 | 100.0 | 1200 | 8 | 1
137| 2.00 | 200.0 | 1200 | 8 | 1
138| 2.00 | 250.0 | 1200 | 8 | 1
139| 2.00 | 500.0 | 1200 | 8 | 1
140| 5.00 | 100.0 | 1200 | 8 | 1
141| 5.00 | 200.0 | 1200 | 8 | 1
142| 5.00 | 250.0 | 1200 | 8 | 1
143| 5.00 | 500.0 | 1200 | 8 | 1
144| 0.10 | 0.0 | 2400 | 8 | 1
145| 1.00 | 0.0 | 2400 | 8 | 1
146| 2.00 | 0.0 | 2400 | 8 | 1
147| 5.00 | 0.0 | 2400 | 8 | 1
148| 0.00 | 30.0 | 2400 | 8 | 1
149| 0.00 | 60.0 | 2400 | 8 | 1
150| 0.00 | 100.0 | 2400 | 8 | 1
151| 0.00 | 200.0 | 2400 | 8 | 1
152| 0.00 | 250.0 | 2400 | 8 | 1
153| 0.00 | 500.0 | 2400 | 8 | 1
154| 0.00 | 1000.0 | 2400 | 8 | 1
155| 0.01 | 200.0 | 2400 | 4 | 1
156| 0.01 | 250.0 | 2400 | 6 | 1
157| 0.01 | 500.0 | 2400 | 6 | 1
158| 0.01 | 1000.0 | 2400 | 6 | 1
159| 0.10 | 200.0 | 2400 | 6 | 1
160| 0.10 | 250.0 | 2400 | 6 | 1
161| 0.10 | 500.0 | 2400 | 8 | 1
162| 0.10 | 1000.0 | 2400 | 8 | 1
163| 0.50 | 200.0 | 2400 | 8 | 1
164| 0.50 | 250.0 | 2400 | 8 | 1
165| 0.50 | 500.0 | 2400 | 8 | 1
166| 0.50 | 1000.0 | 2400 | 8 | 1
167| 2.00 | 200.0 | 2400 | 8 | 1
168| 2.00 | 250.0 | 2400 | 8 | 1
169| 2.00 | 500.0 | 2400 | 8 | 1
170| 2.00 | 1000.0 | 2400 | 8 | 1
171| 5.00 | 200.0 | 2400 | 8 | 1
172| 5.00 | 250.0 | 2400 | 8 | 1
173| 5.00 | 500.0 | 2400 | 8 | 1
174| 5.00 | 1000.0 | 2400 | 8 | 1
175| 0.10 | 0.0 | 4800 | 6 | 1
176| 1.00 | 0.0 | 4800 | 8 | 1
177| 2.00 | 0.0 | 4800 | 8 | 1
178| 5.00 | 0.0 | 4800 | 8 | 1
179| 0.00 | 30.0 | 4800 | 8 | 1
180| 0.00 | 60.0 | 4800 | 8 | 1
181| 0.00 | 100.0 | 4800 | 8 | 1
182| 0.00 | 200.0 | 4800 | 8 | 1
183| 0.00 | 250.0 | 4800 | 8 | 1
184| 0.00 | 500.0 | 4800 | 8 | 1
185| 0.00 | 1000.0 | 4800 | 8 | 1
186| 0.00 | 2000.0 | 4800 | 8 | 1
187| 0.01 | 500.0 | 4800 | 6 | 1
188| 0.01 | 1000.0 | 4800 | 6 | 1
189| 0.01 | 2000.0 | 4800 | 6 | 1
190| 0.10 | 500.0 | 4800 | 6 | 1
191| 0.10 | 1000.0 | 4800 | 6 | 1
192| 0.10 | 2000.0 | 4800 | 8 | 1
193| 0.50 | 500.0 | 4800 | 8 | 1
194| 0.50 | 1000.0 | 4800 | 8 | 1
195| 0.50 | 2000.0 | 4800 | 8 | 1
196| 2.00 | 500.0 | 4800 | 8 | 1
197| 2.00 | 1000.0 | 4800 | 8 | 1
198| 2.00 | 2000.0 | 4800 | 8 | 1
199| 5.00 | 500.0 | 4800 | 8 | 1
200| 5.00 | 1000.0 | 4800 | 8 | 1
201| 5.00 | 2000.0 | 4800 | 8 | 1

Available notch filters
===================================
num| hpfr | lpfreq | sfr | or | type
===================================
000| 48.00 | 52.0 | 128 | 4 | 1
001| 58.00 | 62.0 | 128 | 4 | 1
002| 48.00 | 52.0 | 256 | 4 | 1
003| 58.00 | 62.0 | 256 | 4 | 1
004| 48.00 | 52.0 | 512 | 4 | 1
005| 58.00 | 62.0 | 512 | 4 | 1
006| 48.00 | 52.0 | 600 | 4 | 1
007| 58.00 | 62.0 | 600 | 4 | 1
008| 48.00 | 52.0 | 1200 | 4 | 1
009| 58.00 | 62.0 | 1200 | 4 | 1
010| 48.00 | 52.0 | 2400 | 4 | 1
011| 58.00 | 62.0 | 2400 | 4 | 1
012| 48.00 | 52.0 | 4800 | 4 | 1
013| 58.00 | 62.0 | 4800 | 4 | 1
 

WBahn

Joined Mar 31, 2012
30,290
You will have to figure out the attenuation by looking at the characteristics of an nth order Butterworth filter with the given cutoff frequencies. I'm not going to spend the time doing that for you.
 

Thread Starter

Gpand

Joined Dec 11, 2023
105
You will have to figure out the attenuation by looking at the characteristics of an nth order Butterworth filter with the given cutoff frequencies. I'm not going to spend the time doing that for you.
I was not asking about the actual attenuation by the Butterworth. Just asking if this digital thing is as good as using variable analog filters for say 0 to 2400Hz? In medical or other equipments. Do they use variable anti aliasing filters before the ADC or do they do it just like the method used by g.USBamp? Is the following as good as pure analog filters? Or would you still choose analog filters anyday? but someone said at PSE when asked about the same g.USBamp:

"240MHz is the USB2 HS Nyquist frequency. 960MHz is typical internal frequency of USB PHY. The description does not mention any antialiasing filtering upfront of the amplifiers, and sampling at 2.4Mz could produce any fake frequency, and no digital post-processing will fix this."

What fake frequency does it mean? Fake frequency in the sense that the original frequency can contain frequency between 2400hz and 5000Hz? but won't the digital 1000Hz low pass filter eliminate the fake frequency (whatever it means)?
 

WBahn

Joined Mar 31, 2012
30,290
"good as" is a very vague term. If you were to spend an additional $20k in order to have variable analog filters and they performed as well as the "digital thing", would that quality as being "as good as"? You need to establish constraints on your comparisons. As mentioned a few times above, One of the reasons that oversampling is used is to reduce the complexity and cost of the analog anti-aliasing filter. So if you want to put all your analog filter to be where everything happens, you have to be willing to pay the cost associated with that.

As for what "someone at PSE" said, they are saying that there are plenty of noise sources at very high frequencies that want to put that content into the ADC output. The "fake frequencies" being referred to are the aliased frequencies. If you sample at 2400 Sa/s and you have content at 960 MHz, that content is going to appear in your date at a frequency of somewhere between - Hz and 1200 Hz. ALL signal content at the input, regardless of frequency, is going to appear somewhere between DC and half the sampling rate, and once it is there, there is no way to get rid of it because it is indistinguishable from the signals that did not get aliased. The only way to avoid this is to use an analog antialiasing filter before the ADC. What they appear to taking issue with is that they don't think that there is ANY analog antialias filter before the ADC. I don't think that this is the case -- just because some description fails to mention it, or does so in a way that isn't obvious, does not mean that it isn't there.
 

Thread Starter

Gpand

Joined Dec 11, 2023
105
"good as" is a very vague term. If you were to spend an additional $20k in order to have variable analog filters and they performed as well as the "digital thing", would that quality as being "as good as"? You need to establish constraints on your comparisons. As mentioned a few times above, One of the reasons that oversampling is used is to reduce the complexity and cost of the analog anti-aliasing filter. So if you want to put all your analog filter to be where everything happens, you have to be willing to pay the cost associated with that.

As for what "someone at PSE" said, they are saying that there are plenty of noise sources at very high frequencies that want to put that content into the ADC output. The "fake frequencies" being referred to are the aliased frequencies. If you sample at 2400 Sa/s and you have content at 960 MHz, that content is going to appear in your date at a frequency of somewhere between - Hz and 1200 Hz. ALL signal content at the input, regardless of frequency, is going to appear somewhere between DC and half the sampling rate, and once it is there, there is no way to get rid of it because it is indistinguishable from the signals that did not get aliased. The only way to avoid this is to use an analog antialiasing filter before the ADC. What they appear to taking issue with is that they don't think that there is ANY analog antialias filter before the ADC. I don't think that this is the case -- just because some description fails to mention it, or does so in a way that isn't obvious, does not mean that it isn't there.
You said above the only way to avoid the aliasing of the say 960Mhz is via analog antialiasing filter. But you also said earlier that it could be done digitally too like "Further antialiasing filtering needed to reduce the sample rate further can be done digitally. If this is done by averaging signals (instead of just taking every nth sample), the SNR can be improved by another factor of sqrt(n)." So did you mean aliasing cant be removed digitally at all? If it can. why did you say that " the only way to avoid the aliasing of the say 960Mhz is via analog antialiasing filter". Im kinda confused. Pls elaborate. Many thanks.
 

WBahn

Joined Mar 31, 2012
30,290
You said above the only way to avoid the aliasing of the say 960Mhz is via analog antialiasing filter. But you also said earlier that it could be done digitally too like "Further antialiasing filtering needed to reduce the sample rate further can be done digitally. If this is done by averaging signals (instead of just taking every nth sample), the SNR can be improved by another factor of sqrt(n)." So did you mean aliasing cant be removed digitally at all? If it can. why did you say that " the only way to avoid the aliasing of the say 960Mhz is via analog antialiasing filter". Im kinda confused. Pls elaborate. Many thanks.
As soon as you digitize a single by sampling it, you create a single that fundamentally has no content above half the sampling rate (unless you are doing IQ sampling, but that's not the case, here). Any content in the input signal above that is aliased down to a frequency below that limit. Once that happens, there's no way to undo it because it is no longer a high frequency signal. It is now a signal at the aliased frequency and is indistinguishable from any other signal originally at that frequency. So you have to suppress signals above half the sampling rate BEFORE you sample them.

For an analog signal, the only way to do that is with an analog filter -- you can't use any kind of digital filter because the signal isn't a digital signal.

Once it is digitized, the signal only contains content up to half the sampling rate. Everything else is gone, either because it was removed by the antialiasing filter, or it was aliased down to a frequency below half the sampling rate.

If you want to decimate the signal to create a new digital signal that is at an even lower sampling frequency, you have to remove any content in the input digital signal that is above half the new sampling rate and, as before, that has to be done BEFORE the downsampling occurs. But this can be done digitally, in fact, it has to be done digitally since you are now working with a digital signal.
 

Thread Starter

Gpand

Joined Dec 11, 2023
105
As soon as you digitize a single by sampling it, you create a single that fundamentally has no content above half the sampling rate (unless you are doing IQ sampling, but that's not the case, here). Any content in the input signal above that is aliased down to a frequency below that limit. Once that happens, there's no way to undo it because it is no longer a high frequency signal. It is now a signal at the aliased frequency and is indistinguishable from any other signal originally at that frequency. So you have to suppress signals above half the sampling rate BEFORE you sample them.

For an analog signal, the only way to do that is with an analog filter -- you can't use any kind of digital filter because the signal isn't a digital signal.

Once it is digitized, the signal only contains content up to half the sampling rate. Everything else is gone, either because it was removed by the antialiasing filter, or it was aliased down to a frequency below half the sampling rate.

If you want to decimate the signal to create a new digital signal that is at an even lower sampling frequency, you have to remove any content in the input digital signal that is above half the new sampling rate and, as before, that has to be done BEFORE the downsampling occurs. But this can be done digitally, in fact, it has to be done digitally since you are now working with a digital signal.
So in conclusion. The following statement is wrong?

"FilterEnabled
Choose 1 if you want a pass band filter, and 0 if you don't. The gUSBamp is a DC amplifier and thus you most likely will want a pass band filter. Please note that, because the g.USBamp internally has a 5kHz antialiasing filter and always samples with 38.4kHz, you DO NOT need to enable any filter if you do not want. You will never experience aliasing."

It is wrong because for all bio-signal signal from 0 to 2400Hz where the unit is built to work with. It can suffer full fledge aliasing in all signals. For example. For 512Hz sampling with 256Hz Nyquist signal that most R&D use. It can suffer aliasing from 256Hz to 512Hz and the 5kHz analog antialiasing filter is useless. It is only useful only for stopping all the white noise above 5kHz. So is it correct for the statement to be this instead:

"FilterEnabled
Choose 1 if you want a pass band filter, and 0 if you don't. The gUSBamp is a DC amplifier and thus you most likely will want a pass band filter. Please note that, because the g.USBamp internally has a 5kHz antialiasing filter and always samples with 38.4kHz. YOU WILL ENCOUNTER ANALOG ALIASING IN ALL ACTIVE BIOSIGNAL FROM 0 TO 2400Hz. FilterEnabled 1 can only make you filter the white noise. But not any frequency below 5kHz that can become source of aliasing."

The edit is correct? Because I'd suggest the BCI people (who are not manufacturer) to remove the wrong statement in the following: "Please note that, because the g.USBamp internally has a 5kHz antialiasing filter and always samples with 38.4kHz, you DO NOT need to enable any filter if you do not want. You will never experience aliasing."
 

WBahn

Joined Mar 31, 2012
30,290
I don't know the details of this part, but based on what information you've given above, it seems like the only way to choose, say, 4800 Sa/s is to configure it for that by choosing one of the options from 175 through 201. Each of those options imposes a digital filter that kills everything about 2400 Hz. Is there a separate way to configure the device to decimate the signal to 4800 Sa/s without, at the same time, selecting one of the available filter options for that sampling rate?
 

Thread Starter

Gpand

Joined Dec 11, 2023
105
I don't know the details of this part, but based on what information you've given above, it seems like the only way to choose, say, 4800 Sa/s is to configure it for that by choosing one of the options from 175 through 201. Each of those options imposes a digital filter that kills everything about 2400 Hz. Is there a separate way to configure the device to decimate the signal to 4800 Sa/s without, at the same time, selecting one of the available filter options for that sampling rate?
By using FilterEnabled 0. You won't have any bandpass at all at 4800Hz. Besides that. There is no other way to decimate from 38400Hz to 4800Hz (or below). In the g.USBamp manual and BCI2000 book. It is not 5kHz Low pass but 6.6kHz. here is the manual page:

gUSBamp 6kHz low pass.jpg

This is the page in the book. so this passage is wrong? Quoted "FilterLowPass Low-pass frequency for band-pass filter. See description of the USBampgetinfo tool (page 205) for more info. Please note that, because the g.USBamp has a 6.8 kHz hardware-based antialiasing filter, internally samples at a very high rate, and then downsamples the signal to the desired sampling rate, you will never experience aliasing even if you do not enable a low-pass filter."

It is wrong becuase 1) It has only 6.6kHz analog anti-aliasing filter. 2) if you don't enable any filter. Downsizing from 38,400Hz to 4800Hz would introduce digital aliasing by accepting the digital signal between 2400Hz and 6600Hz which can cause aliasing just like you mentioned in your last message. Right?

usbamp parameter.jpg
 
Last edited:

WBahn

Joined Mar 31, 2012
30,290
How do you choose a sampling rate of 4800 Sa/s without choosing a low pass filter? I have no idea whether this is possible or not. I don't have the manual, all I have are the snippets you choose to show. Keep in mind that the original manual was probably written in another language (German??) and then translated to English by someone that is completely non-technical.
 

Thread Starter

Gpand

Joined Dec 11, 2023
105
How do you choose a sampling rate of 4800 Sa/s without choosing a low pass filter? I have no idea whether this is possible or not. I don't have the manual, all I have are the snippets you choose to show. Keep in mind that the original manual was probably written in another language (German??) and then translated to English by someone that is completely non-technical.
One can digitally downsample by not using any analog low pass filter, isn't it? The act of downsampling or decimating to 4800Hz can be considered using digital low pass filter. But it won't remove the false signal that gets below 6.6kHz, right?

The original manual is all written in english. Gtec is from Austria and very good english speaking. Here is the manual:

gUSBamp30_InstructionsForUse.docx (nbtltd.com)

Anyway. I have this unknown 958Hz peak when I do FFT to my signal via Matlab. The following is using 4800Hz but no bandpass. (FilterEnabled set to 0). All 3 inputs of channel 1 is shorted.

gusbamp 4800hz no filters fft.jpg

I can't figure out the source of the 958.5Hz peak. The second peak at 1912Hz is the harmonic. Do you think it is ESD damage? USB polling artifact? Factory flaw? Aliasing from lack of any analog antialiasing below 6.6kHz? In the following I used a bandpass of 5Hz to 1000Hz in the 4800Hz sampling bandpass option.

gusbamp 4800hz bandpass 5hz to 1000hz.jpg

The above is with all inputs shorted. When I let them become opened (with no shorting of the In+, In-, ground) in the following. The peak moves to 911Hz and smaller amplitude. Any theory of the origin of the peak? Thanks.

gusbamp 4800hz opened inputs.jpg
 
Top