Loading ...
Sorry, an error occurred while loading the content.

Re: [buildcheapeeg] comADC-EEG

Expand Messages
  • Joerg Hansmann
    Hi Rob , ... From: Rob Sacks To: Sent: Thursday, August 09, 2001 1:41 PM Subject: Re: [buildcheapeeg]
    Message 1 of 27 , Aug 9, 2001
    • 0 Attachment
      Hi Rob ,

      ----- Original Message -----
      From: Rob Sacks <editor@...>
      To: <buildcheapeeg@yahoogroups.com>
      Sent: Thursday, August 09, 2001 1:41 PM
      Subject: Re: [buildcheapeeg] comADC-EEG


      > Hi Joerg,
      >
      > > The greatest deviation I see, is about 40usec.
      > > That is 1% jitter at 250 Hz sampling clock.
      >
      > Is this big or small? :) I have no idea.

      I think, it is no problem, because the sample clock
      is far away from the upper -3db corner frequency of the
      amplifier.

      Another thing is, that the comADC produces sample clock
      phase deviation of up to 90 degrees that is input voltage
      dependant by itself. That is simply, because 0 V input delivers
      the AD-value at once, while max input delivers the value after
      1 ms.

      However this jitter and phase deviation can be easily
      compensated by software, if the exact point of time
      (either from PIT or RDTSC) is stored together with the AD-value.


      > This question came up before because somebody
      > in this group asked me privately whether Windows
      > was sufficiently accurate to provide the timing
      > for the EEG-soundcard idea. That's why I wrote the
      > little test program.
      >
      > I told the person who asked me that I didn't think
      > Windows was good enough for this purpose, but
      > maybe I owe him a correction and an apology.
      >
      > Is it possible to calculate the error in the FFT
      > frequency domain that will result from the error
      > in the time intervals between measurements? I didn't
      > know how to do this.

      Yes. It can be done. My comADC DOS-Software has a
      simulation mode that calculates a sinewave signal
      that is used to test the FFT.

      I could simply add a random phase to simulate
      the 1% jitter.


      > If you want, Joerg, I'll write a new test program using
      > the rtsdc instruction and generate similar numbers
      > from other machines. The numbers I sent
      > earlier are from an 800 MHz machine.

      That would be interesting. However I guess that
      the jitter will essentially stay the same, but you
      can measure it with greater accuracy.


      > > However I assume we have to use multiples
      > > of 1 ms ? So we can have 500Hz, 333Hz, 250Hz,
      > > 200Hz etc. but no power of 2 frequencies.
      >
      > Correct.
      >
      > > The PIT (8253) is clocked with 1.19318 MHz.
      > > The 16-bit divider has been set to 65536 under DOS
      > > and produced the legendary 18.2 Hz
      >
      > Yes, it's coming back to me. It's very frightening
      > that I could forget this because there was a time
      > in my life when I did a lot of programming for
      > that chip. I once spent a week trying to avoid the
      > need to check for overflow by setting two of the
      > three counters on the chip to relatively prime
      > divisors so I could latch both simultaneously and
      > get a unique number that could be higher than the
      > overflow value... something like that, I forget
      > exactly! :) Is such a bad memory normal for 48
      > years old? Maybe I meditate too much. :)

      I always thought meditation were good for memory ?
      A friend has told me about earliest childhood memories
      in a deeply relaxed state.

      >
      ...

      > My guess is that the .8 usec Windows timer is
      > emulating the timer chip frequency, but not using
      > the timer chip, because to get that precision it
      > would have to service the clock interrupt at the
      > maximum frequency

      That is not necessary. The timer chip could be set to 1193
      (the exact but impossible value would be 1193.18)
      and would then produce one interrupt each 1 msec.

      If you want to check the time in between the interrupts,
      you simply read out the timer counter register, that
      is clocked with 1.19318 Mhz.


      > and that would waste a lot
      > of cycles (I don't think the system normally requires
      > that level of precision).
      > I have a book here somewhere
      > on Windows internals that probably gives the
      > explanation but I can't find it.
      >
      > More reasons for my guess: Microsoft didn't introduce
      > the .8 usec timer until the CPU counter was added
      > by Intel; and with the other, older timer services,
      > the application programmer has to specify the level
      > of desired precision before using the services, which
      > suggests to me that the clock-interrupt rate is kept
      > as slow as possible and only increased when
      > necessary.

      I must admit that I have not the slightest experience with
      windows programming.


      > > What does out of order execution mean ? (something with
      > > the pipelines ?)
      > > And why should this be a problem ?
      >
      > It's an optimization technique. Intel introduced it with
      > the Pentium Pro but I think all modern CPUs do it.
      ...
      > Intel warns that this might not work because
      > both rdtsc's may execute before the fdiv.

      Yes , I understand.


      > But it's easy to avoid this problem using the
      > CPUID instructions or some other instruction
      > that forces all previous instructions to complete.
      ...
      > By the way, the Intel article is here:
      >
      > http://cedar.intel.com/cgi-bin/ids.dll/content/content.jsp?cntKey=Legacy::irtp_RDTSCPM1_12033&cntType=IDS_EDITORIAL
      >

      Thanks. I will have a look at it.


      Regards,

      Joerg
    • Joerg Hansmann
      hi, ... From: Rob Sacks To: Sent: Thursday, August 09, 2001 1:41 PM Subject: Re: [buildcheapeeg]
      Message 2 of 27 , Aug 9, 2001
      • 0 Attachment
        hi,

        ----- Original Message -----
        From: Rob Sacks <editor@...>
        To: <buildcheapeeg@yahoogroups.com>
        Sent: Thursday, August 09, 2001 1:41 PM
        Subject: Re: [buildcheapeeg] comADC-EEG
        ...
        > > The greatest deviation I see, is about 40usec.
        > > That is 1% jitter at 250 Hz sampling clock.
        >
        > Is this big or small? :) I have no idea.


        The simulation shows that even a jitter of 2 ms,
        what is 51.2% jitter at 256 Hz sample clock,
        has not much impact on the FFT of a 8 Hz wave.

        However the waveform is slightly distorted.

        (see pictures)

        Regards,

        Joerg
      • Rob Sacks
        Hi Joerg, Thanks for answering my questions and providing the screen shots. Very interesting, I appreciate it. I ll look at them more carefully over the
        Message 3 of 27 , Aug 10, 2001
        • 0 Attachment
          Hi Joerg,

          Thanks for answering my questions and providing
          the screen shots. Very interesting, I appreciate it.
          I'll look at them more carefully over the weekend.

          > I always thought meditation were good for memory ?
          > A friend has told me about earliest childhood memories
          > in a deeply relaxed state.

          I've noticed that old memories often surface
          unexpectedly during meditation but maybe this
          involves a different mental mechanism from the
          attempt to deliberately recall something? Or
          maybe childhood memories are different in this
          respect from memories created in adulthood?

          > That is not necessary. The timer chip could be set to 1193
          > (the exact but impossible value would be 1193.18)
          > and would then produce one interrupt each 1 msec.
          >
          > If you want to check the time in between the interrupts,
          > you simply read out the timer counter register, that
          > is clocked with 1.19318 Mhz.

          Yes, of course you're right. I wasn't thinking.

          > I must admit that I have not the slightest experience with
          > windows programming.

          Oh, how I envy you! :)

          Regards

          Rob
        • peterson@discover-net.net
          ... Rob--This often happens in alpha-theta training as well. I think it s partly because the censors that otherwise guard consciousness are relaxed and let
          Message 4 of 27 , Aug 10, 2001
          • 0 Attachment
            --- In buildcheapeeg@y..., "Rob Sacks" <editor@r...> wrote:
            >
            > I've noticed that old memories often surface
            > unexpectedly during meditation but maybe this
            > involves a different mental mechanism from the
            > attempt to deliberately recall something? Or
            > maybe childhood memories are different in this
            > respect from memories created in adulthood?
            >
            Rob--This often happens in alpha-theta training as well. I think
            it's partly because the "censors" that otherwise guard consciousness
            are relaxed and let things in that would otherwise be excluded.
            Also, in this state the mind is less directed by outside stimuli, so
            it is free to wander and follow old associative networks into
            "forgotten" corners, etc. Remember William James' beautiful metaphor
            of the bird flitting from branch to branch? It is definitely very
            different from deliberate retrieval efforts.
          • Rob Sacks
            Hi Jim, One of these days I really must keep my resolution to fire up the old Brainmaster and experiment a bit more with alpha-theta. Thanks for mentioning the
            Message 5 of 27 , Aug 12, 2001
            • 0 Attachment
              Hi Jim,

              One of these days I really must keep my resolution
              to fire up the old Brainmaster and experiment a bit
              more with alpha-theta.

              Thanks for mentioning the metaphor. Had to hunt
              it down and realized that although I read Varieties
              of Religious Experience in college, I've never
              even glanced at Principles of Psychology. Plan to
              do so in the next few days. Just began reading the
              chapter in which the metaphor occurs and have
              become entranced. Thanks for mentioning it.

              Regards,

              Rob


              ----- Original Message -----
              From: <peterson@...>
              To: <buildcheapeeg@yahoogroups.com>
              Sent: Friday, August 10, 2001 12:22 PM
              Subject: [buildcheapeeg] Re: comADC-EEG


              > --- In buildcheapeeg@y..., "Rob Sacks" <editor@r...> wrote:
              > >
              > > I've noticed that old memories often surface
              > > unexpectedly during meditation but maybe this
              > > involves a different mental mechanism from the
              > > attempt to deliberately recall something? Or
              > > maybe childhood memories are different in this
              > > respect from memories created in adulthood?
              > >
              > Rob--This often happens in alpha-theta training as well. I think
              > it's partly because the "censors" that otherwise guard consciousness
              > are relaxed and let things in that would otherwise be excluded.
              > Also, in this state the mind is less directed by outside stimuli, so
              > it is free to wander and follow old associative networks into
              > "forgotten" corners, etc. Remember William James' beautiful metaphor
              > of the bird flitting from branch to branch? It is definitely very
              > different from deliberate retrieval efforts.
              >
              >
              >
              > To unsubscribe from this group, send an email to:
              > buildcheapeeg-unsubscribe@egroups.com
              >
              >
              >
              > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
              >
              >
            • jiva@humboldt1.com
              ... I m going to jump in here and make another plug for an on-board A D chip. Plus: Low cost, multi-channel, high-resolution, fast, low cpu consumption, serial
              Message 6 of 27 , Aug 13, 2001
              • 0 Attachment
                > > Is possible add 16 bit dig. counter ( or 2 x 8bit ), I think also
                > > cheap.
                > > Time resolutin would be high, I read that new 555 reached output
                > > frekvency at about 2.4 MHz.
                >
                > 2 cheap asychronous counters would be ok.
                > You need a 16 Mhz (or whatever the counters can manage)
                > crystal oscillator to generate the clock for the counter.
                > The 555 would generate a gate time for the 16Mhz clock.
                >

                I'm going to jump in here and make another plug for
                an on-board A>D chip.

                Plus: Low cost, multi-channel, high-resolution, fast,
                low cpu consumption, serial out units only require a few
                opto-isolators for i/o, ...

                Minus: a driver must still provide accurate conversion
                timing and retreive/store the results in a timely manner.
                However this seems much less complicated and requires
                orders of magnitude fewer cpu resources than the
                555/serial port scheme.

                In any case ... the new 555 design is more exciting news
                from Joerg and the group.
              • jiva@humboldt1.com
                ... I m still lurking, learning, and stirring up trouble here. not to worry.
                Message 7 of 27 , Aug 13, 2001
                • 0 Attachment
                  >
                  > I told the person who asked me that I didn't think
                  > Windows was good enough for this purpose, but
                  > maybe I owe him a correction and an apology.
                  >

                  I'm still lurking, learning, and stirring up
                  trouble here. not to worry.
                • Rob Sacks
                  Namaste, Jiva-ji, Yikes, I m sorry! I meant to forward those messages to you but got distracted over the weekend. Glad you saw them. Regards, Rob ... From:
                  Message 8 of 27 , Aug 13, 2001
                  • 0 Attachment
                    Namaste, Jiva-ji,

                    Yikes, I'm sorry! I meant to forward those
                    messages to you but got distracted over the
                    weekend. Glad you saw them.

                    Regards,

                    Rob

                    ----- Original Message -----
                    From: <jiva@...>
                    To: <buildcheapeeg@yahoogroups.com>
                    Sent: Monday, August 13, 2001 11:46 PM
                    Subject: [buildcheapeeg] Re: comADC-EEG


                    >
                    > >
                    > > I told the person who asked me that I didn't think
                    > > Windows was good enough for this purpose, but
                    > > maybe I owe him a correction and an apology.
                    > >
                    >
                    > I'm still lurking, learning, and stirring up
                    > trouble here. not to worry.
                    >
                    >
                    >
                    >
                    >
                    >
                    > To unsubscribe from this group, send an email to:
                    > buildcheapeeg-unsubscribe@egroups.com
                    >
                    >
                    >
                    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                    >
                    >
                  • Vladimir.K
                    ... I ve finished older variant of comADC-EEG , the gameport. ( I used TLC272 and 9V Battery). Now, I am reading gameport on old Linux box and sending to other
                    Message 9 of 27 , Oct 4, 2001
                    • 0 Attachment
                      --- In buildcheapeeg@y..., "Joerg Hansmann" <info@j...> wrote:

                      > It is a quick and dirty prototype. The GUI is not finished.
                      > All setup is via #define in the source.
                      > So if you want to run it on your PC you probably
                      > have to make some adjustments and recompile
                      > it with DJGPP (and the allegro gaming library).
                      >
                      > If you are not scared until now, I can mail you the
                      > source code and/or the executable.
                      >
                      > Regards,
                      >
                      > Joerg

                      I've finished older variant of comADC-EEG , the gameport.
                      ( I used TLC272 and 9V Battery).
                      Now, I am reading gameport on old Linux box and sending to
                      other machine (W98) to Electric Guru.

                      Even some experiment with kernel Real Time extension ( KURT ) and
                      altering parameters in joystick driver, results are not perfect. It's
                      only 120MHz Pentium.


                      I would like to try your code for DOS, so if you can, send me, please
                      it. (gogol101@...)

                      One curiosity:
                      I didnt think that 9V is dangerous, but when I mesured resitance of
                      EEG electrod ( home made saline type ) I got el. shock and becaus
                      I had electrode on forehead near eye so I saw light flash.
                      ( I have 9V battery in Ohmmeter).

                      If I remember, you said that RS232EEG is limited to 8( or 6 ) channels
                      for limited bandwith on RS232 ( 115 kbaud).
                      I was suprised when I saw on Linux possible setting for 230 and 460
                      kbaud. I am curious if so high speed is real.

                      Regards
                      Vladimir
                    • Joerg Hansmann
                      Hi Vladimir, ... From: Vladimir.K To: Sent: Thursday, October 04, 2001 6:20 PM Subject: [buildcheapeeg]
                      Message 10 of 27 , Oct 5, 2001
                      • 0 Attachment
                        Hi Vladimir,

                        ----- Original Message -----
                        From: Vladimir.K <gogol101@...>
                        To: <buildcheapeeg@yahoogroups.com>
                        Sent: Thursday, October 04, 2001 6:20 PM
                        Subject: [buildcheapeeg] Re: comADC-EEG


                        ...
                        > I've finished older variant of comADC-EEG , the gameport.
                        > ( I used TLC272 and 9V Battery).
                        > Now, I am reading gameport on old Linux box and sending to
                        > other machine (W98) to Electric Guru.
                        >
                        > Even some experiment with kernel Real Time extension ( KURT ) and
                        > altering parameters in joystick driver, results are not perfect.

                        What sample rate and how many bits resolution do you get ?

                        > It's
                        > only 120MHz Pentium.
                        >
                        >
                        > I would like to try your code for DOS, so if you can, send me, please
                        > it. (gogol101@...)

                        I will send it via email.
                        However it is for the comADC02 hardware.

                        > One curiosity:
                        > I didnt think that 9V is dangerous, but when I mesured resitance of
                        > EEG electrod ( home made saline type ) I got el. shock and becaus
                        > I had electrode on forehead near eye so I saw light flash.
                        > ( I have 9V battery in Ohmmeter).

                        A normal ohmmeter is not very suitable for measuring electrode
                        impedance, because it uses DC (resulting in electrode
                        polarization) and probably exceeds the limits of IEC601-1
                        (therefore you got the electric shock and the light-effects)


                        > If I remember, you said that RS232EEG is limited to 8( or 6 ) channels

                        6 channels, because the AT90S4433 has only 6 analog multiplexer inputs.

                        > for limited bandwith on RS232 ( 115 kbaud).

                        There are other limiting factors too like ADC conversion speed.

                        > I was suprised when I saw on Linux possible setting for 230 and 460
                        > kbaud. I am curious if so high speed is real.

                        If the UART chip on the mainboard can handle that speed, I see no
                        reason why such settings should not work.
                        For RS232EEG however the upper limit is 115200 baud due to
                        xtal-frequency and minimum possible baudrate divider factor.

                        Regards,

                        Joerg
                      • Vladimir.K
                        Hi Joerg, sory for late answer, I am busy now. ... I have not mesured it yet. My etimation that it s worse than 8 bit on 256 sampling. Now 256 samples per
                        Message 11 of 27 , Oct 11, 2001
                        • 0 Attachment
                          Hi Joerg,

                          sory for late answer, I am busy now.

                          --- In buildcheapeeg@y..., "Joerg Hansmann" <info@j...> wrote:

                          > What sample rate and how many bits resolution do you get ?
                          >

                          I have not mesured it yet. My etimation that it's worse than 8 bit
                          on 256 sampling. Now 256 samples per second is too high.
                          But there is growing potencial. I saw some tricks with setting
                          interrupt-unmask flag for IDE driver ( prog. hdparm ) and
                          IRQ priority optimalization. ( www.best.com/~cae/irqtune/ )
                          Maybe ideas from irqtune are also worth for DOS programs.

                          I also don't understand all code in joystick driver.

                          > I will send it via email.
                          > However it is for the comADC02 hardware.

                          Than you.

                          Regards
                          Vladimir
                        • Joerg Hansmann
                          Hi Vladimir, ... From: Vladimir.K To: Sent: Thursday, October 11, 2001 3:01 PM Subject: [buildcheapeeg]
                          Message 12 of 27 , Oct 13, 2001
                          • 0 Attachment
                            Hi Vladimir,

                            ----- Original Message -----
                            From: Vladimir.K <gogol101@...>
                            To: <buildcheapeeg@yahoogroups.com>
                            Sent: Thursday, October 11, 2001 3:01 PM
                            Subject: [buildcheapeeg] Re: comADC-EEG


                            > Hi Joerg,
                            >
                            > sory for late answer, I am busy now.

                            No problem.

                            >
                            > --- In buildcheapeeg@y..., "Joerg Hansmann" <info@j...> wrote:
                            >
                            > > What sample rate and how many bits resolution do you get ?
                            > >
                            >
                            > I have not mesured it yet. My etimation that it's worse than 8 bit
                            > on 256 sampling. Now 256 samples per second is too high.
                            > But there is growing potencial. I saw some tricks with setting
                            > interrupt-unmask flag for IDE driver ( prog. hdparm ) and
                            > IRQ priority optimalization. ( www.best.com/~cae/irqtune/ )
                            > Maybe ideas from irqtune are also worth for DOS programs.

                            While the gameport timing loop is running, simply no interrupt must
                            be processed. Or are you using another technique than polling ?

                            IMO the advantage of simple and low cost hardware of the gameportEEG
                            or comEEG is more than compensated by the resulting difficulties with
                            software.

                            Regards,

                            Joerg
                          Your message has been successfully submitted and would be delivered to recipients shortly.