Help with windowing transform and then FFT from a list/stream of numbers

Kiellong's icon

Hello all,

It's been a while since using max/msp and I need a bit of help.

I have a input from a digital device that I need to perform some maths on to obtain (usable) frequency numbers.

Basically...

the list comes in from udpreceive and gets filtered by OSC to the separate channels...an example of the info is attached with a bang every second as a time marker.

I then need to perform a windowing function and an FFT to obtain the frequency in real time as workable numbers.

I am guessing I need to convert this into audio (as if its sound it will be much faster to process the numbers right?) but when using the "number~" object the output is VERY slow... as in misses about 99% of the data.

My questions are...
How should I go about using the number list and doing a windowing function and FFT to be able to obtain a working integer list?

any help would be greatly appreciated with this!

k

2508.fewsecondofdatafromaf3.txt
txt
Floating Point's icon

Don't use a number box to covert a list to audio-- use sig~ instead

you could try this method below-- there are probably better / more elegant/accurate solutions but this is a start.

I put your printed list into a message box and then iterate it at 300hz which seems to be the data sample rate.
I then scale it so it's between +-1 before converting audio

Max Patch
Copy patch and select New From Clipboard in Max.

As far as analysis goes, look at the fft and pfft help patches and tutorials-- but you'll need to down-sample the audio to the data sampling frequency (apparently approx 300hz) to get meaningful results

Floating Point's icon

Don't use a number box to covert a list to audio-- use sig~ instead

you could try this method below-- there are probably better / more elegant/accurate solutions but this is a start.

I put your printed list into a message box and then iterate it at 300hz which seems to be the data sample rate.
I then scale it so it's between +-1 before converting audio

Max Patch
Copy patch and select New From Clipboard in Max.

As far as analysis goes, look at the fft and pfft help patches and tutorials-- but you'll need to down-sample the audio to the data sampling frequency (apparently approx 300hz) to get meaningful results

Kiellong's icon

Hi,

thank you very much... I will try this today.
I think the data was 256? but will need to check...
Will post updates but again thank you for your help!

Kiellong's icon

Hi,

thank you very much... I will try this today.
I think the data was 256? but will need to check...
Will post updates but again thank you for your help!

Floating Point's icon

btw my scaling bit of the patch is wrong-- it scales the data to between +-0.5, not +-1, so there's a [* 2] box you need to slip in somewhere... not that this affects any spectral analysis you would do later on

Floating Point's icon

btw my scaling bit of the patch is wrong-- it scales the data to between +-0.5, not +-1, so there's a [* 2] box you need to slip in somewhere... not that this affects any spectral analysis you would do later on