Is it possible to have a high resolution FFT.

Status
Not open for further replies.

kd9kck

Active member
I am wondering if there is a way to get a high resolution FFT with the teensy. I am trying to find tones that are only 15 or so hz apart.
 
FFT frequency resolution depends on sample rate and number of samples. More samples gives higher resolution.
 
This I understand but I was asking if the teensy had any build-in FFT that was of a higher resolution because its existing library only has as high as fft1024.
 
Maybe this can help?

https://forum.pjrc.com/threads/42221-Audio-Library-and-4096-point-FFT-on-Teensy-3-6

But if your signal isn't perfectly phase sync'd to the FFT's 4096 samples (which pretty much never happens except when you generate test signals and then analyze them after they've gone through analog circuits and come back in), you still need a window scaling to avoid the FFT's spectral leakage problems. Different window shapes have slightly different properties, but they all end up smearing the bins. That's an unavoidable outcome to use FFT for signals that aren't perfectly phase synchronous with the FFT's window.

Also consider 4096 points is nearly 1/10th of a second. If you're analyzing music or other natural sounds, consider whether the tone you want remain a consistent frequency for the FFT's entire 4096 points. Or if not all 4096, at least most of them in the middle that the window scaling allows to strong affect the results.

For many uses where you just want to detect the fundamental frequency of a complex sound, the NoteFreq (YIN algorithm) analysis gives better results.
 
I am wondering if there is a way to get a high resolution FFT with the teensy. I am trying to find tones that are only 15 or so hz apart.

at which frequency?
How many tones?
there are different signal processing options that allow you to do that.
 
I am trying to get what frequency exists in an area from around 0hz to 2000Hz. Specifically I am trying to get the audio from my laptop from WSJT-X set to FT8 to drive an SI5351 for usage on the HF Bands.


Tone spacing is specifically 6.25 Hz.
And a delay between changing freqs of 159ms.

Now that I think of it I am not sure a Teensy is even up to this task. :(


I might be able to calculate the frequency of the tone but that locks my into specific freq in FT8. (Which would be fine, I think.)


Also its annoying to not be able to log on or use this form while on campus at my college. Seems their whole block of public IPv4 Address they hand out devices on campus is IP banned here.
 
You still haven't mentioned a sample rate. Assuming it is far above Nyquist you can decimate the data to reduce the sample rate. (Low pass filter to remove frequencies above the new Nyquist frequency first!)

If that isn't enough, translate the frequency of interest to a lower frequency so you can use an even lower sample rate.
 
Also, FT8 uses only 8 frequencies, so you may consider 8 DFT's with proper designed window length and variable base frequency.
 
Not sure what sample rate I will being using because I can't seem to find sampling rate information in the docs for AudioInputAnalog or AudioInputUSB.

I am going to take a random guess at the sample rate being around 44100hz as that is the normal-ish sampling rate of PC sound cards.

Also I am not sure how translating the frequency would help, its already between 0 Hz and 2Khz.

Currently I have no code and also need to figure out where my Teensy went. (Somehow lost it while a USB cable was even plugged into it.)

Yes I am aware FT8 uses only 8 frequencies also having a variable base frequency wouldn't help unless I could send that base frequency to the Teensy to update it. (I could try that possibly.)
 
Not sure what sample rate I will being using because I can't seem to find sampling rate information in the docs for AudioInputAnalog or AudioInputUSB.

yes the audiocard uses 44.1 kHz, but I would nobody prohibits to add your own custom modules. However YMMV.

In principle you could do: find and decode all FT8 signals in passband. (I guess original SW does this)
 
FWIW - WSJTX uses a sampling frequency of 12000Hz when generating and decoding FT8 messages and the tone spacing is 6.25Hz - not 15Hz. The default sampling frequency of the audio board is 44100Hz but you can set it to other rates such as 12000Hz, or 8000Hz.

Are you trying/hoping to decode FT8 on a teensy?

Pete
 
I am hoping to just convert the audio from my computer to a RF signal using a SI5351 and some filtering. (Because harmonics are bad.)

I can receive on 40m and 20m with my RTLSDR and wanted to finally get into HF with out having to spend alot of money on a base rig. (Been General for almost a year and I still have not done any HF.)
 
I was thinking of getting one of those eventually but right now its not very economical for me. Only have a part time job and i am in college. I have two Si5351 and a 40m band pass filter. I also have a Teensy and way to many ESP32s. (I should figure out how to port Teensys great audio libraries to it sometime for fun.)

The ubitx is $160 shipped. Which is over a 1/4 of my two week paycheck.

I am only on VHF and UHF because I already had the radios. (My dad and mom are hams.)
 
As an update I had to order a new teensy because the one I had for this project disappeared. USPS says it should be delivered on Saturday. I have silly question. Is it be better to use the Arduino IDE with the changes to it or to just use VS Code with PlatformIO that I use for all my other microcontrollers (Arduino,ESP32)?
 
Okay So I did an experiment using the existing example for FreqMeasure. It appears that even with a 200hz signal from an audio jack. (Made sure to be 3.3 volts.) it can't find the freq very well at all.
 
Use the existing 1024 point FFT on the 2KHz bandwidth data to find the 50Hz band of interest. Then perform a frequency shift (like an analog mixer) to move that down closer to DC. Perhaps centered on 100Hz. Then decimate to reduce the sample rate.

FFT frequency resolution is fs/N so 1,000SPS would get you 1Hz resolution.
 
Okay. I will have to figure out how to write a decimate function because there is none built into the teensy audio library itself.
 
I have silly question. Is it be better to use the Arduino IDE with the changes to it or to just use VS Code with PlatformIO that I use for all my other microcontrollers (Arduino,ESP32)?

Platformio with VS Code works well, but you first still have to add Teensyduino to the Arduino IDE to get it to work. Once you’ve got Arduino+Teensyduino to work okay, then you should be okay to run from within Platformio.
 
Thank you everyone so far for all the help. I will be working on some code to share over the next few days. (Mostly tomorrow.)

I might also use this project as a starting point for making a WSPR decoder. (Way easier to decode that then FT8) As currently this project is to run a SI5351 off the audio output of my computer.
 
I am going to listen to audio from my laptop. (From WSJT-X)

While WSJT-X is transmitting will be the audio representation of the FT-8 (or other mode) signal that would normally go into a Single Side Band transmitter. This audio basically generates a FSK signal out from the transmitter. Where the frequency of the audio is about (slight offset) how far it is away from the tuned frequency of the radio.

I plan on trying to get the dominate frequency during theses times from the audio to run a Si5351 instead of a full radio. Where the Teensy will have a base frequency that it then adds the audio frequency to. This new frequency is then what is used to tune the Si5351.

I hope I am making sense. Quite often I find that I am not good at explaining things to people because I start rambling on about stuff.

William Gaylord, KD9KCK
 
Status
Not open for further replies.
Back
Top