From: Joerg Hansmann (info_at_jhansmann.de)
Date: 2002-01-15 16:15:35
Hi Doug,
----- Original Message -----
From: Doug Sutherland <wearable_at_earthlink.net>
To: <buildcheapeeg_at_yahoogroups.com>
Sent: Tuesday, January 15, 2002 2:49 AM
Subject: Re: [buildcheapeeg] Re: optical coupler
> Hi Joerg,
>
> > RS232EEG protocol operates with 56 kbaud.
>
> What sampling rate is being used at 56k?
200 Hz or 256 Hz.
> Have you
> tried lower rates?
No. Not while developing the amplifier section.
Poor electrode connection and/or poor amplifier properties
result in 50/60Hz line hum pickup. To see 50/60Hz
in the samples and not their aliases (mirrored at
f_sample / 2) I had to use a sample frequency that
is somewhat above 2*60Hz.
And ... for the modularEEG with its 5pole anti-alias
filter it is essential, that the filter cutoff frequency
and the sample frequency have a fixed ratio or else
the anti-alias filter either wastes bandwidth or
aliasing will ocurr.
> I have looked at about a dozen
> small EEGs and all seem to use 9600 baud. What
> happens if you set it to 19.2k? Is it not fast
> enough?
Not for 6 channels (at 16 bit per channel) at 200Hz.
However if 19.2k is important, you could reduce the
number of channels or sample rate in the firmware.
> > 115.2k baud is to have a BW reserve in the case
> > that the modularEEG is extended to more channels,
> > higher sampling rate, etc.
>
> Reserve sounds like a good thing, but 115.2k is
> tenfold what most small EEGs are using.
9600 baud gives 960 bytes per second (assumed 1 startbit,
8 databit and 1 stopbit, together 10bit per byte)
2 channels * 1 byte_per _channel gives 2 byte data
per dataframe. Adding at least 1 byte for sychronization
gives 3 bytes per frame for a minmalistic protocol.
Max. possible Sample rate = 960 / 3 = 320 Hz
That should be enough for 256 Hz.
> I would
> like to understand what the practical maximum
> sampling rate is and what baud rate is needed to
> support that. Any ideas?
Yes ;-)
Feel free to play around with the calculation examples
to get a feeling for the baud-rates and sample rates.
excerpt from the EEG02.c firmware documenation:
"...
calculation of required baud rate:
----------------------------------
Bits per datenbyte sent: 1 startbit + 8 datenbits + 1 stopbit + 0 Parity =10 bit
minimal baudrate is: 16 byte * 200Hz * 10 bit/byte = 32000 baud.
to be open for future extensions I choose 57600 baud.
(that corresponds to a baudrate divisor UBR=7 at 7.3728Mhz Xtal-frequency)
calculation of frequency/timing:
--------------------------------
SIG_OVERFLOW0 (Timer 0 -Interrupt) : 3600 Hz. /18 = 200 Hz
transmission of 1 byte(1+8+1 bit) at 57600 baud : 5760 Hz
sampling of 1 10-bit AD-value: 26(1st) , 14(single conversion) cycles
ADC-Prescaler: > ((XTAL / 200khz)=36.864).
chosen:64 (ADPS2=1,ADPS1=1,ADPS0=0)
ADCYCLE=XTAL/64=115200Hz or 8.681E-6 Sec/Cycle
14(single conversion) cycles = 121.5E-6 sec (8.2E3 samples/sec)
26(1st conversion) cycles = 225.69E-6 sec
..."
Regards,
Joerg
This archive was generated by hypermail 2.1.4 : 2002-07-27 12:28:36 BST