20

Support FFT Analysis


Avatar
Tim
A

Activity Newest / Oldest

Avatar

Tim

(#94194)
"FFT is essential when working with a mixed logic analyzer such as Saleae Logic.
I need FFT to check the output of analog and digital filters."


B

be

Hi everyone,
I recently found a simple solution to analyze an analog signal captured with the Saleae Logic 8 by performing a Fast Fourier Transform (FFT) in Audacity. I thought I'd share the steps here in case someone else finds it useful.
Steps:

Capture and Export Data:
Use the Saleae Logic software to capture your analog signal.
Export the captured data as a CSV file (make sure it includes your signal values). Here "Channel 0".

Normalize and Convert CSV to WAV:
Use the following Python script to:
Extract the signal values.
Normalize the data between -1 and 1.
Convert the data to a WAV file.

Here’s the script:
-----------------------------------------------------------------
import numpy as np
import pandas as pd
from scipy.io.wavfile import write

def charger_csv(fichier_csv):
data = pd.read_csv(fichier_csv, delimiter=",")
if "Line" in data.columns:
return data["Channel 0"].values
else:
raise ValueError("The CSV file must contain a 'Channel 0' column.")

def normaliser_donnees(donnees):
min_val = np.min(donnees)
max_val = np.max(donnees)
return 2 * (donnees - min_val) / (max_val - min_val) - 1

def creer_fichier_wav(donnees, frequence, fichier_sortie):
donnees_int16 = np.int16(donnees * 32767)
write(fichier_sortie, frequence, donnees_int16)
print(f"WAV file created successfully: {fichier_sortie}")

if __name__ == "__main__":
fichier_csv = input("Enter the path to the CSV file: ")
donnees_line = charger_csv(fichier_csv)

if donnees_line is not None:
donnees_normalisees = normaliser_donnees(donnees_line)
frequence = int(input("Enter the sampling rate (Hz): "))
fichier_sortie = input("Enter the output WAV file name (e.g., output.wav): ")
creer_fichier_wav(donnees_normalisees, frequence, fichier_sortie)
else:
print("Failed to process the file.")
-------------------------------------------------------------------
Open the WAV File in Audacity:

Import the generated WAV file into Audacity.
Go to Analyze > Plot Spectrum to perform the FFT analysis of your signal.

Hope this helps anyone looking to analyze signals captured with a Saleae Logic 8


  • S
S

Scientist

Oh man, that’s great!
I’m going to test your solution some time next week. 💪🏼

Still looking forward for the real time FFT analysis from the Salea team…

Regards, Ales Zupanc.


S

Scientist

It took me long to test but I did it finally!

This script works!

But with one small change (using latest Saleae Logic v2.4.22) there is no "Line" field in the CSV file. Channel's data is exported as "Channel 0", "Channel 1", etc. so you need to modify that for your use case (just replace the string 'Line' with valid 'Channel...' string).

Regards, Ales Zupanc.


B

be

Thanks, man. I just made the modifications. However, the name of the channel changes if you rename the different channels in the 'Logic' software.


A

Aleš

The FFT function would be really nice and very practical! I have Saleae 8 PRO and FFT is practically the only function that's missing.

C'mon guys this topic seems to be active for years now...


J

Julian

I would like to bring attention to this as well. Doing a quick and easy fft on some analog data would be quite handy in many cases.


  • A
Avatar

Tim

(#86879)
"I saw in the forum couple years ago has a plan to implement FFT of analog signal.
Are any ideas then it will be implemented?"


S

Scientist

Hi guys.
I’m coming from the R&D lab and I’m a Hardware & Firmware developer. In the office we use three Saleae 8 PROs.

-> It’d be really great if FFT analysis would’ve appear in the Logic 2.

Following this thread and looking forward to see the FFT implementation.


  • A
K

Kevin

Any traction on FFT extension?


  • S
Avatar

Tim

As of now, we have no updates to share on this feature request unfortunately.


Avatar

Tim

(#63944)
"Feature Request - Fixed-point in-place Fast Fourier Transform. analysing audio signals"


Avatar

Tim

(#59033)
"Feature Request - FFT For Analog channels. This will give frequency domain info for the analog signal"


Avatar

Tim

(#58144)
"I want to do FFT analysis with analog input.
Could you add new extension for it?"