65536 + 256j # ӈล͕େ͖ͦ͏ʹࢥ͑Δ͕... Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: '<' not supported between instances of 'complex' and 'complex' ॱংମʹ͓͚ΔฏํݩඇෛͰ͋Δɻ Hayao (Shizuoka 2020) All about cmath module February 29, 2020 12 / 33
!n : ແݶڃͰఆٛ͢Ε͍͍Μͩʂ ez := 1 X n=0 zn n! : ࣮വͰఆٛ͢Ε͍͍Μͩʂ ez := ex(cos y + i sin y) where z = x + iy. Hayao (Shizuoka 2020) All about cmath module February 29, 2020 18 / 33
[ sum( sampling_fs[n] * cmath.exp(-2j * cmath.pi * k * n / sampling_freq) for n in range(sampling_freq) ) for k in range(sampling_freq) ] Hayao (Shizuoka 2020) All about cmath module February 29, 2020 24 / 33
inverse_Fs = [ sum( (1 / sampling_freq) * Fs[n] * cmath.exp(2j * cmath.pi * k * n / sampling_freq) for n in range(sampling_freq) ) for k in range(sampling_freq) ] # ࣮෦͚ͩऔΓग़͢ real_attr = operator.attrgetter("real") inverse_Fs_real = list(map(real_attr, inverse_Fs)) Hayao (Shizuoka 2020) All about cmath module February 29, 2020 28 / 33