'showspectrumpic' filter: scaling of the frequency axis and fft windows size

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

'showspectrumpic' filter: scaling of the frequency axis and fft windows size

Wolfgang Hugemann
Today, I have been experimenting with the 'showspectrum' filter, mostly
with 'showspectrumpic'.

I think there is a bug in the log scaling of the frequency axis if (and
only if) it doesn't start at zero: The ratios of the frequency axis'
labelings is not constant, they grow with larger values.

I had a quick look at the source code and gained the impression that the
fft windows size is based on the height of video created (?). At least
it cannot by specified in the filter options.

Kind regards
Wolfgang Hugemann
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: 'showspectrumpic' filter: scaling of the frequency axis and fft windows size

Paul B Mahol
On 9/13/19, Wolfgang Hugemann <[hidden email]> wrote:

> Today, I have been experimenting with the 'showspectrum' filter, mostly
> with 'showspectrumpic'.
>
> I think there is a bug in the log scaling of the frequency axis if (and
> only if) it doesn't start at zero: The ratios of the frequency axis'
> labelings is not constant, they grow with larger values.
>
> I had a quick look at the source code and gained the impression that the
> fft windows size is based on the height of video created (?). At least
> it cannot by specified in the filter options.

Because used fft accepts only power of 2 sizes.
There is code already for more advanced fft but it is not optimized,
and thus not yet used.

>
> Kind regards
> Wolfgang Hugemann
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: 'showspectrumpic' filter: scaling of the frequency axis and fft windows size

Wolfgang Hugemann
> Because used fft accepts only power of 2 sizes.

Well, this is clear to me - but what size do you use? My use of the term
'window' may be unclear in this context: I meant the window size for the
fft, i.e. how many samples are used in one fft run? I take from your
code that the window size is two times the output windows width (? ...
rounded to ...?).

...

I already tried scaling the frequency axis with 2^n, i.e. 4096 Hz or
8192 Hz, by that did not help. I think there is something basically
wrong with the scaling of the frequency axis if you use log.

Furthermore, the value that you supply for parameter 'stop' seems to be
divided by roughly 2 (?).

>There is code already for more advanced fft but it is not optimized,
>and thus not yet used.

To my knowledge, all such calculations use fft, i.e. 2^n window sizes,
mostly with about 50% overlap (as you also do for most windows in your
code).

Wolfgang Hugemann
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".