0
$\begingroup$

I have a sequence of (real) numbers that represent the magnitude of a certain natural event. I know that the samples are equispaced in time, but not the exact value of the spacings. So does that mean I do not know the sampling rate? And, how should I proceed on to doing a DFT on this dataset?

P.s. Let's say the dataset represents a historical record of the heights of high-tides on an unknown planet with one or more natural satellites. I know that the data points are equispaced, but I don't know the exact value of the spacing.

$\endgroup$
0
$\begingroup$

Continuing from my comments.

The units equation in the comments usually has these variables:

$$ f_{Hz} = k \cdot \frac{F_s}{N} $$

Where $k$ is the bin index. This can be rearranged a little bit to:

$$ f_{Hz} = \frac{k}{N} \cdot F_s $$

This equation shows that the frequencies associated with the bin indexes increases linearly up the bin scale until it reaches the sampling rate. Halfway (for even N) you reach the Nyquist bin. So the Nyquist bin's frequency is half the sampling rate, and a pure tone at the Nyquist frequency will always have two samples per cycle, no matter what the frame size or sampling rate.

In contrast, the musical octave scale is the log base 2 of the frequency, it is not linear.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for the clarification. I have $N=125$ point input file which represent some proxy for the heights of high tides. I run: F =fft(lm) where lm is the $N$-point input file. In the plot of the power spectrum I set the $x$-axis to freq where freq=np.linspace(0, 3.14, 125). Finally, in the power spectrum, I look for the index with the highest power and convert that index to the number of high tides in a bundle using: $2\pi/freq[index]$ By 'bundles' I mean a certain number of consecutive high tides that comprise a cycle (i.e., repeats itself daily, fortnightly, etc). Is this correct? $\endgroup$ – Ranjan May 24 at 15:03
  • $\begingroup$ @Ranjan I don't do MATLAB due to its indexing issue on display here. The $k$th bin represents $k$ cycles per frame, independent ofthe $N$ value. In MATLAB, that is index $k+1$. The fft doesn't care about your linspace, the plotting routine does. No, you are not going to find localized information in the DFT. You are going to find out if your values undulate in some manner. $\endgroup$ – Cedron Dawg May 24 at 15:05
  • $\begingroup$ @ Cedron Dawg Thanks, actually I have updates the comment, can you please take another look... $\endgroup$ – Ranjan May 24 at 15:09
  • $\begingroup$ Since you have MATLAB, I suggest you generate some mixed tone signals, run them through the DFT, and examine the results. BTW, with multiple moons the high tides won't be equidistant unless there is a perfect resonance in the orbits. $\endgroup$ – Cedron Dawg May 24 at 15:12
  • $\begingroup$ @ Cedron Dawg I am using Python 3.7. What you are saying is correct about the orbital resonance, but I want to know the number of days in a lunar month of the unknown planet. So, say a bundle of 4 consecutive high tides represents a daily cycle, and a in a 'lunar month' the bundles of 4 high tide values gradually reach a maximum and minimum,. By counting the number of bundles of 4, we can deduce the length (in days) of the lunar month. An example (media.springernature.com/lw685/springer-static/image/…) $\endgroup$ – Ranjan May 24 at 15:30
1
$\begingroup$

If you don’t know the sample spacing, you don’t know the sample rate.

If you know that samples are uniformly spaced, you can do a DFT and get relative frequencies. You won’t be able to map one dft bin to a specific frequency (in Hertz) unless there is some additional side info (perhaps a known reference hidden within the data).

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for the quick reply. I get an idea of what you are trying to say here. But, I'm new to Fourier transforms and so could you please expound a bit, or point to some worked out example. $\endgroup$ – Ranjan May 24 at 8:05
  • $\begingroup$ @Ranjan Let's suppose your desired unit of frequency is Hertz (cycles per second). The DFT gives you results in cycles per frame. To convert the results of the DFT into the units you want, you need two more values. $N$ in units of samples per frame and $F_s$ in units of samples per second. $$ \frac{Cycles}{Second} = \frac{Cycles}{Frame} \cdot \frac{ \frac{Samples}{Second} }{ \frac{Samples}{Frame} } $$ All you are missing is samples per second. $\endgroup$ – Cedron Dawg May 24 at 11:52
  • $\begingroup$ Thanks, I am getting to it. But, what exactly is a "frame"? $\endgroup$ – Ranjan May 24 at 11:57
  • $\begingroup$ @Ranjan The sampling interval (or duration) in the domain. A set of $N$ uniformly sampled points in a row. It can also be thought of as a vector. $\endgroup$ – Cedron Dawg May 24 at 14:10
  • $\begingroup$ Actually, I should have just referenced dsp.stackexchange.com/questions/67243/… $\endgroup$ – Cedron Dawg May 25 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.