| The normalisation factor is N/2. I guess if you are analysing things like a naive (non-bandlimited) square wave
you might get some mag results going over 1.0.
Note that this is what you’d also get if you used Python & numpy
>>> import numpy as np
>>> a = np.zeros(4096)
>>> a[0:2048] = 1
>>> a[2048:4096] = -1
>>> s = np.fft.rfft(a)
>>> abs(s[1])
2607.5948432810956
========================
Prof. Victor Lazzarini
Maynooth University
Ireland
> On 7 Jul 2024, at 20:26, Pierre Clisson wrote:
>
> Hi,
>
> What is the maximum magnitude that can be returned by rect2pol or mags after rfft, assuming a rectangular window?
>
> I am performing the analysis on a ftable converted to array. I was expecting the maximum amplitude to be N/2 (that is the case for a sine wave), but some waveforms (such as a naive square) return values up to 2607 for an array of 4096 points.
>
> Thanks,
>
> Pierre
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
|