## Problem with FFT

### Problem with FFT

Hello,

The FFT of a 100kHz square seems not always correct. See the pictures

Only "500kHz_8Bit.png" looks correct.

I connect the function generator to input A with a BNC-cable.

I use PicoScope® 6 - PC Oscilloscope software version: 6.10.16.2 with PicoScope 5243A

Best regards

egonotto

The FFT of a 100kHz square seems not always correct. See the pictures

Only "500kHz_8Bit.png" looks correct.

I connect the function generator to input A with a BNC-cable.

I use PicoScope® 6 - PC Oscilloscope software version: 6.10.16.2 with PicoScope 5243A

Best regards

egonotto

### Re: Problem with FFT

Look at the 100kHz square with a sample rate of 199 and 496 kS/sec

And you will see why the fft is showing the data you posted.

That it works at 500 kS/sec is because the source clock of the generator is the same as the clock source of the scope.

If you had used a external function generator you would get the same odd fft's.

Try making the FFT with 1GS/sec then all works ok.

Benno

And you will see why the fft is showing the data you posted.

That it works at 500 kS/sec is because the source clock of the generator is the same as the clock source of the scope.

If you had used a external function generator you would get the same odd fft's.

Try making the FFT with 1GS/sec then all works ok.

Benno

### Re: Problem with FFT

bennog wrote:Look at the 100kHz square with a sample rate of 199 and 496 kS/sec

And you will see why the fft is showing the data you posted.

That it works at 500 kS/sec is because the source clock of the generator is the same as the clock source of the scope.

If you had used a external function generator you would get the same odd fft's.

Try making the FFT with 1GS/sec then all works ok.

Benno

Hello Benno,

I understand you not. In no of my picture is a sample rate of 199 or 496 kS/sec. The FFT choose the sample rate automatical. I choose the frequency span to 199kHz or 496kHz. Than PicoScope6 choose the sample rate it needs (398kS/sec or 992kS/sec).

I see no argument why I can not FFT the built in functiongenerator.

Why should FFT work or not work when the scope and functiongenerator is synchron?

Best regards

egonotto

### Re: Problem with FFT

See the image below

The 100kHz square wave is at the 1MS/sec not square anymore.

But I can not reproduce your problem with my scope (witch is fixed 12 bit)

I have used an external function generator for this test.

It also makes a lot of difference if your primary view is Spectrum or Scope

The info form the properties window can be very helpful in finding the cause of this.

Benno

The 100kHz square wave is at the 1MS/sec not square anymore.

But I can not reproduce your problem with my scope (witch is fixed 12 bit)

I have used an external function generator for this test.

It also makes a lot of difference if your primary view is Spectrum or Scope

The info form the properties window can be very helpful in finding the cause of this.

Benno

### Re: Problem with FFT

Hello bennog,

thanks for your replay.

How would be your spectrum if you use 90 kHz from extern generator and the equal adjustment in PicoScope as in your picture.

Best Regards

egonotto

thanks for your replay.

How would be your spectrum if you use 90 kHz from extern generator and the equal adjustment in PicoScope as in your picture.

Best Regards

egonotto

### Re: Problem with FFT

When you want to do FFT on a 100 kHz signal with a sampling rate of 1MS you only get 10 samples per period.

For a sine wave this is not a big problem, but when you use a square wave you will get all kinds of interference problems.

Especially when both are not complete in sync as when you do 90 kHz with 1 MHz sampling rate.

Both above samples are from a 90 kHz square wave

1st notice it is not a square wave anymore it is more like a trapezium, because of the slow sampling compared to the frequency of the square wave.

2nd the first has a half period time of 5 us witch is about 100 kHz and the second has a half period time of 6 us this is because the scope is sampling with 1 us intervals so there will never be 5.55 us (witch is 90 kHz), the constant variation of the period time will kill the FFT calculation as shown in your pictures.

I I set the FFT range to 10 MHz (witch gives 20 MS sampling rate) and zoom in on the first 500 kHz of the FFT the image is what you would expect.

Also notice the scope image, the square wave is a square wave again.

If you want more detail on the zoomed part of the FFT you can increase the number of bins so you get the image below.

I used 0.5 Mbins for this one

Benno.

For a sine wave this is not a big problem, but when you use a square wave you will get all kinds of interference problems.

Especially when both are not complete in sync as when you do 90 kHz with 1 MHz sampling rate.

Both above samples are from a 90 kHz square wave

1st notice it is not a square wave anymore it is more like a trapezium, because of the slow sampling compared to the frequency of the square wave.

2nd the first has a half period time of 5 us witch is about 100 kHz and the second has a half period time of 6 us this is because the scope is sampling with 1 us intervals so there will never be 5.55 us (witch is 90 kHz), the constant variation of the period time will kill the FFT calculation as shown in your pictures.

I I set the FFT range to 10 MHz (witch gives 20 MS sampling rate) and zoom in on the first 500 kHz of the FFT the image is what you would expect.

Also notice the scope image, the square wave is a square wave again.

If you want more detail on the zoomed part of the FFT you can increase the number of bins so you get the image below.

I used 0.5 Mbins for this one

Benno.

### Re: Problem with FFT

Hallo bennog,

PicoScope 6 has a "Spectrum Mode". This should work. I can choose span from 100 Hz to 100 MHz in 20 steps. It makes no sense, if you can only use the 100 MHz span.

The attachment shows a 3 MHz square from the internal generator of the PS 5243A with 100 MHz span.

But in this case seems the FFT works ok. The internal generator makes the disturbance.

Best Regards

egonotto

PicoScope 6 has a "Spectrum Mode". This should work. I can choose span from 100 Hz to 100 MHz in 20 steps. It makes no sense, if you can only use the 100 MHz span.

The attachment shows a 3 MHz square from the internal generator of the PS 5243A with 100 MHz span.

But in this case seems the FFT works ok. The internal generator makes the disturbance.

Best Regards

egonotto

### Re: Problem with FFT

Someone at PicoScope has to answer this for you, I can only point you in the direction where the anomaly came from.

Benno

Benno

### Re: Problem with FFT

Well explained.

It all comes down to setting the scope up to accurately collect the data you need and, even though you are running in spectrum mode, the scope operates in the time domain and the fft is created in software.

If you have further questions please use the helpdesk email ticket you have, at support@picotech.com

It all comes down to setting the scope up to accurately collect the data you need and, even though you are running in spectrum mode, the scope operates in the time domain and the fft is created in software.

If you have further questions please use the helpdesk email ticket you have, at support@picotech.com

Martyn

Technical Support Manager

Technical Support Manager