Is it possible to measure the spectrum of extremely low frequencies (1 to 100Hz) with PicoScope?

Which product is right for your exact requirements
Post Reply
oligny
Newbie
Posts: 1
Joined: Fri Oct 30, 2020 3:40 am

Is it possible to measure the spectrum of extremely low frequencies (1 to 100Hz) with PicoScope?

Post by oligny »

Hi,
I want to capture earth's ELF (1 to 100Hz) and save the data to a file for further processing. Can one of the product do that?
Thanks!

Gerry
PICO STAFF
PICO STAFF
Posts: 1034
Joined: Mon Aug 11, 2014 11:14 am

Re: Is it possible to measure the spectrum of extremely low frequencies (1 to 100Hz) with PicoScope?

Post by Gerry »

Hi oligny,

As long as what you are using to detect the ELF waves can isolate them sufficiently and generate a suitable voltage (with the aid of an amplifier if necessary), then you can capture the voltage waveforms. You can then export the waveforms to a data file for external processing. The specific device that you would be best for your application will depend upon the actual waveform being captured, how long it will be captured for, and what you need to see in the data.

Regards,

Gerry
Gerry
Technical Specialist

oasis2016
User
User
Posts: 2
Joined: Fri Jan 06, 2017 4:06 am

Re: Is it possible to measure the spectrum of extremely low frequencies (1 to 100Hz) with PicoScope?

Post by oasis2016 »

It can work, but to get the frequency spectrum of 1~100Hz low frequency, the display is relatively slow, more than 2 minutes.
I am using the latest version of PicoScope 6.
Is this the result? Please the administrator to answer.
Thank you! :D

Gerry
PICO STAFF
PICO STAFF
Posts: 1034
Joined: Mon Aug 11, 2014 11:14 am

Re: Is it possible to measure the spectrum of extremely low frequencies (1 to 100Hz) with PicoScope?

Post by Gerry »

Hi oligny,

The short answer to your question "is this the result?" (I assume you mean "is this the expected result?") is:

Yes, that is the expected result when using Spectrum Mode in a Primary View, in fact it can be significantly longer than that if you use a large Number of Bins (in the Spectrum Options), as shown below:
Low speed - Lowest Bandwidth Highest Frequency Resolution Spectrum View.psdata.png

But you can get much faster plots by using Scope Mode, and then creating a Secondary view of Spectrum Mode (go to Views->Add View->Spectrum), as shown by the Time gate value below:
High Speed- Lowest Bandwidth Highest Frequency Resolution Spectrum View.png
I know that over 3 minutes for a plot doesn't sound fast (especially as you mentioned that a 2 minute capture was too slow) but this is the worst case scenario that you can have for a Spectrum Plot, where you're using the maximum Number of Bins and the minimum Bandwidth (and as you can see from the previous plot, using a Primary View means that the plot is going to take quite a bit longer :D ). So, if you have been plotting the Spectrum in a Primary View, then plotting it in a Secondary View will take a lot less than 2 minutes. If you are already using a Secondary View for the plot then scroll to the bottom for some suggestions on reducing the plotting time further.


The more detailed answer is as follows:
Part (A) is the Math explaining why it is taking a long time to plot your Spectrums and why that is not the case when using a Secondary View (which you can skip over if you're not interested) and Part (B) gives you reasons why you should or should not use either of the 2 methods in the above examples, and gives tips on using a Secondary View.

Part (A)
When you are viewing a Spectrum Plot in a Primary View only (i.e. a single view window that is open), there are 2 key parameters you can change directly that affect how the plot is generated on the display, i.e.:
1/ The "Bandwidth" used for the FFT calculation.
2/ The "Number of Bins" plotted in the Frequency Spectrum.

...and one key parameter that you can change indirectly, i.e.
3/ The "Time gate" (is how long it takes to capture the data in order to plot the display)

...all 3 of which are interdependent, i.e.:
Time gate = Number of Samples * Sample Interval (i.e. the number of samples * the distance between them)
So, Time gate = Number of Samples / Sample Rate ----------------------------------------------------------------- {i}

Bandwidth = Number of Bins * Bin width (i.e. the number of Bins * the distance between them)
but also, Bandwidth = Sample Rate / 2 (because the FFT uses the Nyquist Frequency for the Sample Rate)
So, Sample Rate = 2 * Bandwidth ----------------------------------------------------------------------------------------- {ii}

Number of Bins ≈ Number of Samples / 2 (it's slightly more because more FFT bins are used to plot half of the spectrum)
So, Number of Samples ≈ 2 * Number of Bins ------------------------------------------------------------------------- {iii}

Finally then, Time gate = Number of Samples / 2 * Bandwidth (from {i} & {ii} )
or Time gate ≈ 2 * Number of Bins / 2 * Bandwidth (from {iii} )
which means that Time gate ≈ Number of Bins / Bandwidth

So, if you keep the Number of Bins constant, then if you make the Bandwidth smaller, more time will be needed to plot the Spectrum (i.e. the Time gate will be larger). Also, if you keep the Bandwidth constant, then if you make the Number of Bins larger more time will again be needed. So, when you are using the smallest Bandwidth and the largest Number of Bins, you have the maximum time to wait for the Plot to finish (as in the 1st example I used above).

Picoscope 6 was designed so that it would always use all of the captured values to display a waveform that would completely fill the graphic display, of a Primary View, in any display Mode. So, for a Spectrum Plot in a Primary View it is important that what is displayed on the x-axis (i.e. the Bandwidth) represents all of the data points converted by the FFT.
This means that the Time gate is always proportional to the the number of samples required to fill the Spectrum Plot in a Primary View, and the Sample Interval, and is why you have no independent control over how long it takes to plot the spectrum in a Primary view (i.e. it is fixed by the number of samples you have captured and the sample rate used).

When you have a Scope View open, and also a Secondary View of a Spectrum Plot, you can also control how the Spectrum plot is generated. However, in this Mode the Scope Plot is the Primary view, so the key parameter is the Total Collection Time for all of the samples needed to plot the waveform in the Time Domain on the x-axis (i.e. the Timebase). This means that as the Spectrum Plot is not in the Primary View, the Time gate in the Secondary View is not constrained by the Timebase in the Primary View, and the Sample Interval can be significantly reduced when displaying a large Number of Samples over a narrow Bandwidth, giving you much smaller Time gates in the Spectrum Plot (i.e. faster plots). This is shown in the Second example above, where the Spectrum in the Secondary View has finished being plotted, while the waveform in the Primary view has only had a small portion of it plotted in the same amount of time. So, in the Secondary View, you do have control over the time it takes to plot the Spectrum (because you can vary the number of samples that are used to plot the Spectrum regardless of how many have been captured).


Part (B)
So here, is some practical advice, first of all reasons for choosing whether to use a Primary or Secondary View for a Spectrum Plot, and then tips on using the Secondary View and other methods.

Spectrum Plot in a Primary View - Pros & Cons
Advantage - It's easy to control the most intuitive parameters for viewing a Spectrum (e.g. you can keep the Bandwidth constant while changing the Bin Width, or vice versa).
Advantage - You always plot the Spectrum for the Total Capture Time (so you know it always represents all of the captured data).
Disadvantage - Low Bandwidth and high Frequency Resolution plots take too long.
Disadvantage - You have to keep switching between Modes of display to see Time Domain and Frequency Domain plots (and you can't view both plots of the same captured data).

Spectrum Plot in a Secondary View - Pros & Cons
Advantage - You can quickly plot spectrums of low Bandwidth with a high Frequency Resolution.
Advantage - You can view both Time and Frequency Domain plots of the same captured data, simultaneously.
Disadvantage - Controlling the display parameters using Timebase and Number of Samples is not intuitive, and it's not easy to increment/decrement the Number of Bins, while keeping the Bandwidth constant.
Disadvantage - You can't get quick multiple Spectrum plots (e.g. you can't use 'Peak' or 'Average' for the Spectrum 'Display Mode' without having to wait for the complete capture of the Time domain Plot).

Parameter control in the Secondary View
When using the Secondary View of the Spectrum Plot, in order to change the Time gate, you can either change the TimeBase value, or change the Number of Samples used for the Scope view plot, either of which may or may not change the Time Gate. It can take a little while, getting to understand the way the TimeBase and Number of Samples work together to give you the changes you want. There are ways that you can increment/decrement the TimeBase and the Number of Samples together to change more familiar parameter values, i.e. increase/decrease the Number of Bins only, or a decrease/increase the Bandwidth only. It's more clear and simple if you create a table of how those parameters change as you change the TimeBase and Number of Samples together. Below is a Partially constructed table showing how the Number of Bins and Bandwidth change when adjusting the Timebase and Number of Samples requested. You will notice that while keeping the Number of Bins constant and adjusting the Bandwidth is pretty straightforward, doing it the other way round is a little more convoluted because you have to make adjustments going through all of the possible values for Number of Bins (I didn't have the time to find the right parameter values for a 5kHz Bandwidth and 2048 Bins). UPDATE 14/3/21
The below reply to tomasz, under FURTHER DISCUSSION, highlights another approach to controlling the parameters for adjustment, in a Secondary View of a Spectrum plot, to satisfy your requirements.


Duplicating Spectrum Mode parameter values for simultaneous Time/Frequency viewing
You can also set up the Spectrum Plot in the Secondary View so that it uses the same Values for the Parameters used by a Spectrum Plot in a Primary View (which enables you to make direct observations in both the Time and frequency domain, without having to switch back and forth between the 2 Primary Views), as shown in the Data files and images below:
Same speed Secondary Spectrum View.png
Same speed Primary Spectrum View.png

Snapshots Vs full viewing
Last of all, for Spectrum plots in Secondary views, bear in mind that when using a long TimeBase capture you can only display the Spectrum for a small section at the start of the waveform (because the FFT is limited to displaying a maximum of 1048576 bins). An easy way to check if your Spectrum plot is using all of the captured data is to look at the Number of Samples and Number of Bins listed in the Properties Pane (if the Number of Bins is not approximately equal to half the Number of Samples, then the Spectrum is a snapshot of part of the capture, rather than a representation of the whole capture).

Methods of further reduction in the plotting time
If the Time gate is still too large for you, even when using a Secondary View, then the problem is the limitations of using an FFT to perform the Frequency transformation. In which case, you need to look at other Mathematical methods of creating Frequency Domain Plots, such as Short Time Fourier Transforms (STFT's) which essentially split the plot up into time slices for faster transformation, and Wavelet Transforms, which are much more efficient at transforming smaller detail. You should be able to find Libraries for these (there is certainly an STFT library in Matlab) so that you can create your own Application using our Software Development Kit and a supported Language such as MatLab or Python.

Regards,

Gerry
Gerry
Technical Specialist

oasis2016
User
User
Posts: 2
Joined: Fri Jan 06, 2017 4:06 am

Re: Is it possible to measure the spectrum of extremely low frequencies (1 to 100Hz) with PicoScope?

Post by oasis2016 »

Thank you Gerry!
Your detailed explanation has greatly benefited me! :idea: :oops:

tomasz
User
User
Posts: 2
Joined: Tue Mar 09, 2021 1:21 pm

Re: Is it possible to measure the spectrum of extremely low frequencies (1 to 100Hz) with PicoScope?

Post by tomasz »

Hi Gerry,

As I follow up to this discusion, can you please advise what would be the performance of a FFT on a 50Hz sinewave up to 40th harmonic? FFT would be every 5Hz from 50Hz to 2kHz. What would be the refresh reate?
Thanks and regards
Tomas

Gerry
PICO STAFF
PICO STAFF
Posts: 1034
Joined: Mon Aug 11, 2014 11:14 am

Re: Is it possible to measure the spectrum of extremely low frequencies (1 to 100Hz) with PicoScope?

Post by Gerry »

Hi tomasz,

I have given you a direct answer to your question, using a Secondary Spectrum view, in PART B below.

I have also discussed how this would work in a Primary Spectrum view, and how to view the Time Gate in a more direct way when you have a Bin Width requirement (because, although this gives an inferior waveform repetition rate in your example, this may not always be the case and there may be reasons why other forum users might want to use a Primary Spectrum View).

PART A
In my previous reply, I showed how the time it takes to capture the data required to plot the Spectrum (the Time Gate) is influenced by the Bandwidth and Number of Bins (i.e. Time gate ≈ Number of Bins / Bandwidth) because those are the parameters that we are accustomed to using to control the aspects of the plotted Spectrum.
However to get a more direct relationship between the Time Gate and Bin Width in a Primary View, we can rearrange the Time Gate equation, as follows:
Bandwidth = Number of Bins * Bin Width (from the previous reply)
So, Number of Bins = Bandwidth / Bin Width
and so Time gate ≈ 1 / Bin Width

From the modified Time Gate equation, you can see that it will take less time to capture the data for the Spectrum if (1/Bin Width) is small, i.e. if your Bin Width is as large as it can be. So, if you want a Bin Width of 5Hz, because that is the minimum change in frequency that you want to see, then the ideal Bin width to have would be 5Hz, but if that isn't available then you need make a selection of 'Number of bins' and 'Bandwidth' that will give you the closest value to 5Hz without exceeding 5Hz.
So, as an example, when using a Primary spectrum view, for the specific PicoScope that I'm using, i.e. the PicoScope 4262, I get a bin size of 3.906Hz (which is the closest available Bin Width <5Hz) when the number of bins used is 512 for a Bandwidth of 2kHz, which gives a Time Gate of 256ms, which you can calculate using the equation we created, i.e. Time gate ≈ 1/3.906 ≈ 256ms, and which is shown in the data file and image below:
Primary view Time Gate.png
Primary view Time Gate.psdata
(198.46 KiB) Downloaded 111 times

The total time to plot a waveform will be the time to capture the data for it (the Time Gate) + the time to transfer all of the data to the computer. To accurately find out the time required to capture and transfer the data for a single plot you can measure the time it takes to perform multiple plots and then divide down the total time for all of the plots by the number of plots. So, for my example with the PicoScope 4262, performing 100 capture and transfers in the Primary Spectrum view (as setup in the above data file), and timing it with a stop watch, gave a total plotting time of about 36 seconds to plot 100 waveforms. So, the waveform update period (the time to capture and plot 1 waveform) is 360ms, which means that the transfer time was 104ms per waveform. The transfer time can vary, slightly, due to the time it takes to establish a USB connection in order to transfer the data (so a larger number of repetitions will give you a better representative average of the transfer rates). This means that the best waveform repetition rate using the Primary view of a PicoScope 4262 would be 2.66 waveforms per second.

PART B
If you could set values to get a Bin width of 5Hz, you would get a Time gate ≈ 1/5s ≈ 200ms, which would be the smallest possible Time Gate that you could have for your requirement of a 5Hz bin width (as defined by the Time Gate equation we derived above). When using a Secondary View for the Spectrum plot, the shortest time to capture the data in order to plot the Spectrum repeatedly is limited by the time to perform the Primary plot, i.e. the Timebase (rather than the Time Gate). Fortunately though, for your 5Hz requirement, you can directly set a Timebase of exactly 200ms (because that happens to be one of the selectable Timebase values), and then adjust the number of samples to give you a Bin width less than or equal to 5Hz, as shown in the data file and image below:
Secondary view Time Gate.png
Secondary view Time Gate.psdata
(1.79 MiB) Downloaded 114 times

Note that the Timebase of 200ms is a value fixed in the PicoScope 6 software so it applies to all of our PicoScopes (while Time Gate values may be differ for different PicoScope series). After performing 100 waveform updates the time taken was 31 seconds, giving a single waveform update period of 310ms. This means that the best waveform repetition rate, for a Spectrum plot of a 50Hz fundamental frequency waveform with harmonics up to the 40th, for a Bandwidth of 2kHz and a Bin Width of 5Hz, using the Secondary view of a PicoScope, would be 3.23 waveforms per second.

Using a USB 3 PicoScope would reduce the transfer somewhat (however, I seem to recall that you were considering a 2000 series PicoScope, which is limited to USB 2).

FURTHER DISCUSSION
For the Secondary Spectrum plot example above, you can relatively easily control the bandwidth, and Bin width of the plot by only changing the number of samples requested, for a given Timebase. When you reduce the number of samples, the bandwidth is reduced so you have to avoid reaching your lower Bandwidth limit (the Bin Width is also reduced but doesn't have a relevant lower limit). When you increase the value you increase the Bin Width which again may eventually increase beyond your upper Bin Width limit (and again the Bandwidth will also increase but there is no relevant upper limit). So, this example highlights another approach to using a Secondary View for a spectrum plot, i.e. for a minimum Bandwidth and maximum Bin Width, decide upon a Timebase value and then adjust the Number of Samples to be within your Bandwidth and Bin Width requirements.

Regards,

Gerry
Gerry
Technical Specialist

tomasz
User
User
Posts: 2
Joined: Tue Mar 09, 2021 1:21 pm

Re: Is it possible to measure the spectrum of extremely low frequencies (1 to 100Hz) with PicoScope?

Post by tomasz »

Many thanks for this extensive response Gerry!

Post Reply