Minimum sample length to estimate the frequency of a sinusoid

  • A
  • Thread starter MisterH
  • Start date
  • #1
12
0
Summary:
minimum window length to find the full length of a discretely sampled sinusoid?
Given a discretely sampled horizontal sinusoid of length p, and unknown amplitude, what is the minimal number of consecutive points on a window that is required to correctly estimate its total length, starting at any random point on the wave? Initially I would think it would be either p (full length), or p/2 (half length), right?

estimate_length.png


What if you found a method to correctly estimate its length p on only 3 sample points: would there be a commercial application for this?
 

Answers and Replies

  • #2
berkeman
Mentor
60,555
10,864
Are you guaranteed that it is a noise-free pure sinusoid?
 
  • #3
12
0
Yes
 
  • #4
berkeman
Mentor
60,555
10,864
Then I would think it would be a pretty small number. Is there a reason that you have groups of 3 points in a row circled in the above plot?

Summary:: minimum window length to find the full length of a discretely sampled sinusoid?

What if you found a method to correctly estimate its length p on only 3 sample points: would there be a commercial application for this?
The problem is that commercial applications involve real-world signals that are not pure sinusoids, and generally also involve some level of noise...
 
  • #5
12
0
"Then I would think it would be a pretty small number. Is there a reason that you have groups of 3 points in a row circled in the above plot?"
-> just to illustrate that 1) it can be at any random point and 2) 3 is enough for my method.

"The problem is that commercial applications involve real-world signals that are not pure sinusoids, and generally also involve some level of noise..."
-> Indeed... But given the fact that the sinusoid is more or less the basic shape of nature, I'd think there's something I didn't think of, maybe related to electricity, or signal processing, etc., etc. I'm obviously not a physicist.
 
  • #6
osilmag
Gold Member
157
35
When you sample a signal, don't you have to sample at a freq twice the original? That would be a half wavelength which is what you originally thought.
 
  • #7
12
0
"When you sample a signal, don't you have to sample at a freq twice the original? That would be a half wavelength which is what you originally thought."

-> If I understand it correctly, that's "Nyquist frequency", yes.
 
  • #8
berkeman
Mentor
60,555
10,864
When you sample a signal, don't you have to sample at a freq twice the original? That would be a half wavelength which is what you originally thought.
That's a different situation from what the OP asked originally, if I understood his question and graph:
Summary:: minimum window length to find the full length of a discretely sampled sinusoid?

Given a discretely sampled horizontal sinusoid of length p, and unknown amplitude, what is the minimal number of consecutive points on a window that is required to correctly estimate its total length, starting at any random point on the wave?
It seemed to me that he was implying that the sampling rate was plenty high, he just wanted to be able tell everything about the sinusoid from just a few samples (like not waiting for a complete sinusoid to have to be sampled.
 
  • #9
FactChecker
Science Advisor
Gold Member
6,557
2,636
It depends on how much accuracy you require. The simple Nyquist frequency allows you to get complete accuracy from an infinite sample over an infinite time. Any finite time for the sample will not guarantee complete accuracy. The problem is that you are not guaranteed to get any sample at the exact zero of the sinusoidal. Anything else will give you a possible error for any finite sample.
 
  • #10
35,651
12,217
There are only three degrees of freedom - amplitude, frequency and phase. From a purely mathematical point three samples are sufficient if you are guaranteed to sample at a sufficiently high rate with no errors. That's not a real-life situation of course, where you need to consider measurement uncertainties, deviations from a pure sine wave and so on. In that case longer measurement windows will lead to smaller uncertainties.
 
  • Like
Likes jasonRF, pbuk and berkeman
  • #11
pbuk
Science Advisor
Gold Member
2,505
1,245
When you sample a signal, don't you have to sample at a freq twice the original? That would be a half wavelength which is what you originally thought.
In each case the samples indicated in the graphic are ~10x~ the frequency of the original so this is not relevant.
There are only three degrees of freedom - amplitude, frequency and phase. From a purely mathematical point three samples are sufficient if you are guaranteed to sample at a sufficiently high rate with no errors. That's not a real-life situation of course, where you need to consider measurement uncertainties, deviations from a pure sine wave and so on. In that case longer measurement windows will lead to smaller uncertainties.
Hmmm, I think we need more information: the three points in the second set in the graphic could have come from a waveform at ~10x the frequency.
 
  • #12
berkeman
Mentor
60,555
10,864
Hmmm, I think we need more information: the three points in the second set in the graphic could have come from a waveform at ~10x the frequency.
I don't see that. How so?

1631926721905.png
 
  • #13
pbuk
Science Advisor
Gold Member
2,505
1,245
First point (in the second group) at ## \frac{\pi}2 \phi - \epsilon ## second at ## 3 \frac{\pi}2 \phi ## third at ## 5 \frac{\pi}2 \phi + \epsilon ##?
 
  • #14
35,651
12,217
That's the sampling at a sufficient rate I mentioned. We should be sure the period isn't smaller than our sampling distances.

I don't know if irrational ratios of sampling distances can break that ambiguity already, removing that restriction. What if we sample at times 0,a,b, with a/b irrational?
 
  • #15
pbuk
Science Advisor
Gold Member
2,505
1,245
Putting aside the practical point that all floating point representations are rational (we are talking about digital sampling?), given that any irrational number can be approximated arbitrarily closely by a rational number I don't see how that could help even in theory: how would the processing engine (whether digital or analogue) tell the difference?
 
  • #16
Baluncore
Science Advisor
9,826
4,239
There are only three degrees of freedom - amplitude, frequency and phase. From a purely mathematical point three samples are sufficient if you are guaranteed to sample at a sufficiently high rate with no errors.
If I asked you to interpolate between three equally spaced points in time, using a sine curve, then how might you fit it ?
Note that if the points were co-linear; +v, 0 and -v, then it could not identify the frequency as the data is centred on a zero crossing.
 
  • #17
35,651
12,217
Putting aside the practical point that all floating point representations are rational (we are talking about digital sampling?), given that any irrational number can be approximated arbitrarily closely by a rational number I don't see how that could help even in theory: how would the processing engine (whether digital or analogue) tell the difference?
As I said, this is a purely mathematical result. In real life you profit from a larger range.

@Baluncore: Yes, that's a special case where three points are not sufficient. Luckily your chance to hit this case is 0.
 
  • #18
Baluncore
Science Advisor
9,826
4,239
Yes, that's a special case where three points are not sufficient. Luckily your chance to hit this case is 0.
The theoretically impossible special case needs to be handled correctly by a practical algorithm.

Given a 16 bit A→D converter, the chance of hitting the impossible is better than 1/65k, and there is plenty of digitisation noise on either side of the infinite pitfall. I would expect the algorithm, running continuously, to fail at least once every second.
 

Related Threads on Minimum sample length to estimate the frequency of a sinusoid

Replies
8
Views
919
Replies
12
Views
390
  • Last Post
Replies
7
Views
2K
Replies
9
Views
23K
Replies
1
Views
694
Replies
2
Views
632
Replies
3
Views
865
  • Last Post
Replies
1
Views
1K
Replies
6
Views
2K
Top