cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Mathcad stft function

LB_9931683
3-Visitor

Mathcad stft function

How do I calculate the corresponding frequencies provided by the stft function?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Unfortunately, the help and documentation is not clear on calculating frequency which is more or less automatic within competitive products.  However by trial and error, it appears that stft returns content with max frequency aprox equal to sampling frequency.  Consequently, half of the requested frequencies will be withn the nyquist frequency.  There is still some issue related to the size and indexing (origin=0 or 1, and max length of the returned vector).   Index/length*sampling frequency is the best aproximation I've been able to use.   

 

I prefer DFT for some analysis, but the easiest way to create a spectrogram is with stft.  

View solution in original post

4 REPLIES 4

Hi,

Have you looked at the description and an example in help?

Cheers

Terry 

ttokoro
20-Turquoise
(To:LB_9931683)

PTC_Mathcad_Help/example_the_short_time_fourier_transform.html#wwID0EXHA5

image.pngimage.png

But using dft function is more understandable.

image.pngimage.png

Unfortunately, the help and documentation is not clear on calculating frequency which is more or less automatic within competitive products.  However by trial and error, it appears that stft returns content with max frequency aprox equal to sampling frequency.  Consequently, half of the requested frequencies will be withn the nyquist frequency.  There is still some issue related to the size and indexing (origin=0 or 1, and max length of the returned vector).   Index/length*sampling frequency is the best aproximation I've been able to use.   

 

I prefer DFT for some analysis, but the easiest way to create a spectrogram is with stft.  

ttokoro
20-Turquoise
(To:LB_9931683)

 

Plot data with dft and stft is almost same. The original wave has 1 for magnitude. dft for each 32 data must devide by 16. The one for stft must devide by 2.828. Never use w>0 for stft when you want to get real magnitude value.

image.pngimage.pngimage.png

Top Tags