OK, so here's my problem. Let's say I have a motor running on a fixed frequency PWM of 30KHz. I use a current sense resistor to sense the motor current, and I get a voltage that looks more or less like my PWM waveform. I want to know the average value of my current. (Let's assume I forgot to do the obvious thing and put an analog filter on this signal before I ran it through a mux to an A/D.)
I'm taking an 10uS averaged sample once every millisecond.
I'm horribly undersampling the current sense voltage, but I'm not concerned with the frequency content of the signal, only the average (DC) component.
We know from Fourier analysis that the DC coefficient is independent of frequency. I know that if I take enough samples and average them I'll have the DC component of my current. The question is, how many samples is "enough"? How do I determine the amount of ripple I'll have in my average values, and how does that relate to the number of samples I average?
(Assume my sampling rate is not synchronous to the PWM frequency - a requirement for this sort of undersampling.)
Also assume that I already googled "undersampling average" and went through the first several pages of hits.
Any help?