LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TFA STFT Spectrogram: log scale on frequency axis

Hi,

 

I'm trying to get my spectrogram to display a logarithmic scale on the frequency axis, but whenever I go to the graph properties->y-axis, turn off autoscaling, check the log scale box, hit okay, and then run the vi, I still have a linear scale.  I tried creating a property node for the spectrogram's y-axis and setting the scale to logarithmic, but this doesn't work either.  Does anyone have any suggestions? 

 

Thanks a lot,

 

Chris K.

0 Kudos
Message 1 of 9
(6,172 Views)

bump

0 Kudos
Message 2 of 9
(6,163 Views)

Your frequency axis is the X axis.

0 Kudos
Message 3 of 9
(6,145 Views)

Thanks, but it looks to me like time is my x-axis, frequency is my y-axis, and the color scale is a third "axis," but I'm no expert. 

0 Kudos
Message 4 of 9
(6,121 Views)

Chris,

 

From the Help for an Intensity Graph: "The array indices are the X and Y values for a given Z."  It is not at all obvious how taking the logarithm of the indices would be meaningful.

 

Lynn

0 Kudos
Message 5 of 9
(6,110 Views)

I'm not sure how this addresses my question.  A logarthmic scaling of my frequency axis should not be this complicated...

0 Kudos
Message 6 of 9
(6,104 Views)

log (0), log (1), log (2), log(3), ... ?

 

The Intensity graph uses the array indices (0,1,2,3,...) for the axis, not the values of Y.  If your frequencies are 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, ..., you would need an array with >=1001 elements to get the axis values where you wanted them and it would still plot the axis linearly.  You can certainly put the Z-values for frequency 10 in the 4th column of the array.  To get the labels to display the Y-axis frequencies might require overlaying an X-Y graph with logarithmic mapping of the Y-axis on the Intensity graph.  By making the appropriate parts transparent, you should be able to get the Y-axis display you want.  Tedious, but probably not too difficult.

 

Lynn

0 Kudos
Message 7 of 9
(6,091 Views)

I dont want to actually take the logarithm of my frequencies.  I want a logarithmic scaling of my frequency axis so that lower frequencies are more visible in the spectrogram than frequencies near the nyquist limit.  Here are a couple examples of logarithmic scaling on the y-axis(notice that 1000 is not labeled as 3)log scale.png

 

0 Kudos
Message 8 of 9
(6,073 Views)

I think I understand what you want.  Since the intensity graph only uses linear axes, you need to process the data externally before feeding it to the graph.  That part is easy.  Getting a log scale is the tricky part.  I was suggesting two graphs: an intensity graph with the Y-axis scale invisible and an X-Y graph showing only the Y-axis scale in the log mapping mode to display the log Y-axis scale.

 

Lynn

0 Kudos
Message 9 of 9
(6,053 Views)