Tuesday, June 18, 2019

filters - Moving average and linearization of two piecewise linear systems


I have 2 oversampling ADC's running parallelly, each to process data in a specific range of the input as shown below: enter image description here


Each ADC can process only half cycle range of a sine wave. Each ADC adds its own gain/offset errors. Input is simultaneously applied to different ADCs. Assume one conversion cycle is 1ms and there are 1000 clock cycles (sampling clock).


If the input is of low frequency occuring completely in ADC-1's range or ADC-2's range for one conversion cycle, compensation the gain/offset errors (o1,g1 or o2,g2) of those ADC's respectively is straightforward.


The problem arises during filtering where I need to (moving)average the output from two ADCs which have a different offset and gain errors associated with them. This is where I am stuck.


For simplicity, the filter can be considered a First order Accumulator, (1/z-1). It just averages the 1000 samples.


Below is what I tried:



Since the values o1,g1 and o2,g2 are linear with the number of clock cycles, I tried to find to find a linear equation for them by the following methods:


enter image description here


Now I got four equations for ADC-1 and four for ADC-2 (by matching the input and output of separate ADC's - after the filter - in the following conditions): (after fixing tstart): Eqs-1:



  • o1=a*n+b

  • g1=c*n+d


(after fixing tend): Eqs-2



  • o1'=p*n+q


  • g1=r*n+s


(Similarly for ADC2)


Through which I can correct the following samples occur sequentially in a single conversion cycle:



  • n1 samples from ADC-1 (correct using Eqs-1), n2 samples from ADC-2 ;where (n1+n2=1000)

  • n3 samples from ADC-2 , n4 samples from ADC-1 (correct using Eqs-2) ;where(n3+n4=1000)


Now, I am stuck what if the following happens:




  • n5 samples from ADC-1, n6 samples from ADC-2, n7 samples from ADC-1 (where n5+n6+n7=1000)


This is where I thought, thinking of the filter (1/z-1) as a convolution would help, as I could design the convolution mask differently. Normally, the convolution mask for moving average would look like below:


mask=[1 1 1 1 1 1]; <-- add the factor due to o1/g1 here, modifying each element with 1*(factor), where factor depends on o1/g1 in case of ADC-1


But I am not sure if that would help fixing the problem. Am I making this problem more complicated?




No comments:

Post a Comment

digital communications - Understanding the Matched Filter

I have a question about matched filtering. Does the matched filter maximise the SNR at the moment of decision only? As far as I understand, ...