DEV Community

Stack All Flow
Stack All Flow

Posted on • Originally published at stackallflow.com on

arduino – Does it make sense to plot the angle in an signal spectrum analyzer?

I’ve built a toy oscilloscope with an Arduino, acquiring the samples with the ADC and plotting the spectrum on my computer. The spectrum is the output of the FFT algorithm. You can see a video here of the program in action.

The yellow line is the actual value of each sample as the output from the Arduino’s ADC. The red line is the magnitude of each complex number as the output from the FFT function, and the green plot is the angle of each of those complex numbers. The first spike is noise from the AC main power line, which is 50 Hz.

The red plot shows the “energy” of each frequency. What information does the angle shows? Is there an intuitive explanation?

Accepted Answer:

In this case, the absolute angle you are plotting is relative to the phase at which you are taking samples with your ADC. By the way, it looks like your sample rate isn’t very stable, judging from how much the speed of the waveform moving across the display varies.

It would probably be more useful if you were to provide a triggering function for your oscilloscope, so that you get a stable waveform display to begin with, and then display relative phase, perhaps taking the phase of the largest magnitude peak as your “zero” reference angle.

Keep in mind that the phase information in FFT bins that have low magnitude values is mostly the result of low-level noise, and won’t be very relevant to the overall signal analysis.

Electronic #arduino #sense #plot #angle #signal #spectrum #analyzer

The post arduino – Does it make sense to plot the angle in an signal spectrum analyzer? appeared first on Stack All Flow.

Top comments (0)