3 Replies Latest reply: Dec 21, 2010 9:53 AM by captfoss RSS

    Sampling Amplitude decreases over time

    825360
      Hi all,

      I'm am using the Java Sound API to sample data from a current transformer!
      What's happening to me is that after a while (while being 24 hours for 8000 sps) the amplitude of the signal startes to decrease! If I use 44100 it will decrease event fastest!

      Any ideas why this may be happening?
      My first thought was that I might be loosing samples from the targetdataline while reading from it (my buffer is 1/5 the lenght of the targetdatalinebuffer!

      I've search for this issue all over the place and I couldn't find anything that addresses to this.
        • 1. Re: Sampling Amplitude decreases over time
          captfoss
          user13514642 wrote:
          Any ideas why this may be happening?
          It sounds like perhaps you're not handling the amplitude calculations for a partially filled buffer correctly...
          • 2. Re: Sampling Amplitude decreases over time
            825360
            Hi,

            I dont use amplitude directly! I am extracting the values from both left and right channels and then I calculate the RMS for each period! What's happening is that after some time those RMS values are getting lower and lower.

            For instance, I am sampling voltage, whose value should be almost constant over time!
            • 3. Re: Sampling Amplitude decreases over time
              captfoss
              user13514642 wrote:
              I dont use amplitude directly! I am extracting the values from both left and right channels and then I calculate the RMS for each period! What's happening is that after some time those RMS values are getting lower and lower.
              Those "values" you're extracting are amplitude values, first off, so you are using amplitudes directly.

              Second off, nothing you said above invalidates the idea that you're not handling partially filled buffers correctly.

              Third off, considering you're doing an RMS calculation, there could be a bug in the code that calculates your RMS.

              Fourth off, you may be dealing with some sort of overflow for a counter somewhere in your code.

              Fifth off, you're not going to get any help without posting your code...