ITU-T G.227 複素数フィルタ → 実数フィルタ

まず、ITU-T G.227 https://www.itu.int/rec/T-REC-G.227-198811-I/en

記載の伝達関数を周波数特性としてグラフ化。普通のフィルタのグラフと違ってyはゲインではなくロスなので注意

$$ \frac{E}{2V} = \frac{ 18400 + 91238\ p^2 + 11638\ p^4 + p (67280 + 54050\ p^2) }{ 400 + 4001\ p^2 + p^4 + p (36040 + 130\ p^2) } $$$$ p = j \frac{f}{1000} $$
In [1]:
import numpy as np
from matplotlib import pyplot as plt
from scipy import signal
import json

def g227(niq, size):
    f = np.linspace(0, niq, size)
    p = 1j * f / 1000
    numerator = 18400 + 91238*p**2 + 11638*p**4 + p*(67280 + 54050*p**2)
    denominator = 400 + 4001*p**2 + p**4 + p*(36040 + 130*p**2)
    loss = np.abs(numerator / denominator)
    dB = 20 * np.log10(loss)
    # adjust gain
    dB -= np.min(dB)
    loss = np.power(10, dB / 20)
    return f, loss
In [2]:
sr = 44100
firlen = 513
xticks = [33, 50, 100, 500, 1000, 5000, 10000]

f_m, loss_m = g227(sr/2, 2**13)
f, loss = g227(sr/2, int(firlen/2))

print(np.min(20 * np.log10(loss)))
plt.figure(figsize=(8,10))
plt.title("Frequency response")
plt.xscale('log')
plt.grid(True)
plt.ylabel('Composite loss')
plt.xlabel('Frequency')
plt.ylim((0, 70))
#plt.xlim((33, 10000))
plt.xlim((1, sr/2))
plt.xticks(xticks, xticks)
plt.plot(f, 20 * np.log10(loss), label="length=%d" % int(firlen/2))
plt.plot(f_m, 20 * np.log10(loss_m), label="expected")
plt.legend(bbox_to_anchor=(1, 1), loc='upper right', borderaxespad=1, fontsize=11)

plt.show()
0.0

FIR

そのまま IFFT して有限インパルス応答 (FIR) を得る。フィルタにしたいのでロスの逆数をとってゲインにしている。

In [3]:
fir = np.fft.fftshift(np.fft.ifft(1.0/loss, n=firlen))
print(len(fir))
x = np.linspace(-firlen/2, firlen/2, len(fir))
plt.figure(figsize=(15,5))
plt.title("Impulse response")
plt.grid(True)
plt.ylabel("Coeffs")
plt.xlabel("Samples")
#plt.xlim((-30,30))
plt.plot(x, np.real(fir), label="real")
plt.plot(x, np.imag(fir), label="imag")
plt.legend(bbox_to_anchor=(1, 1), loc='upper right', borderaxespad=1, fontsize=11)
plt.show()
513

FIR の周波数特性

求めた FIR の周波数特性を評価する。freqz を使う。

In [4]:
w, h = signal.freqz(fir, worN=2**13)
x = w * sr * 1.0 / (2 * np.pi)
plt.figure(figsize=(10,10))
plt.title("Frequency response of impulse response (complex)")
plt.xscale('log')
plt.grid(True)
plt.ylabel('Gain')
plt.xlabel('Frequency')
plt.xlim((1, sr/2))
plt.ylim((-100, 10))
plt.xticks(xticks, xticks)

freqz_dB = 20 * np.log10(abs(h))
expected_dB = -20 * np.log10(loss_m)
plt.plot(x, freqz_dB, 'b', label="freqz")
plt.plot(f_m, expected_dB, 'r', label="expected")
plt.legend(bbox_to_anchor=(1, 1), loc='upper right', borderaxespad=1, fontsize=11)
print(len(h) / np.sum(np.abs(h)))

error = np.abs(freqz_dB- expected_dB)
print('Max Error', np.max(error), 'dB', 'at', x[np.argmax(error)], 'Hz')
print('MSE',  20*np.log10(np.sqrt(np.mean(np.power(10, error / 20)**2))), 'dB')

ax2 = plt.twinx()
angles = np.unwrap(np.angle(h))
ax2.plot(x, angles, 'g')
ax2.set_ylabel('Angle (radians)', color='g')

plt.show()
12.702398360824748
Max Error 61.17456417683514 dB at 22006.93359375 Hz
MSE 22.082582995621816 dB

実数フィルタ

実数フィルタにする。

In [5]:
firr = np.copy(np.real(fir))
firr *= 2

w, h = signal.freqz(firr, worN=2**13)
x = w * sr * 1.0 / (2 * np.pi)

plt.figure(figsize=(10,10))
plt.title("Frequency response of impulse response (real)")
plt.xscale('log')
plt.grid(True)
plt.ylabel('Gain')
plt.xlabel('Frequency')
plt.xlim((1, sr/2))
plt.ylim((-100, 10))
plt.xticks(xticks, xticks)

freqz_dB = 20 * np.log10(abs(h))
expected_dB = -20 * np.log10(loss_m)
plt.plot(x, freqz_dB, 'b', label="freqz")
plt.plot(f_m, expected_dB, 'r', label="expected")
plt.legend(bbox_to_anchor=(1, 1), loc='upper right', borderaxespad=1, fontsize=11)
print(len(h) / np.sum(np.abs(h)))
error = np.abs(freqz_dB- expected_dB)
print('Max Error', np.max(error), 'dB', 'at', x[np.argmax(error)], 'Hz')
print('MSE',  20*np.log10(np.sqrt(np.mean(np.power(10, error / 20)**2))), 'dB')

ax2 = plt.twinx()
angles = np.unwrap(np.angle(h))
ax2.plot(x, angles, 'g')
ax2.set_ylabel('Angle (radians)', color='g')
plt.show()
12.698620856044219
Max Error 57.26387170919799 dB at 22006.93359375 Hz
MSE 18.21432638645039 dB

JSON

In [6]:
print(json.dumps(list(map(lambda x: (x.real, x.imag), fir))))
[[-6.180171231999265e-05, -9.363064745945171e-07], [-6.178820397942836e-05, 8.880029113502316e-07], [-6.185158905688193e-05, -9.8419608839212e-07], [-6.181107878306835e-05, 8.392852645665589e-07], [-6.193786502482514e-05, -1.0316718249994602e-06], [-6.187039709126612e-05, 7.901533382799915e-07], [-6.206061673305784e-05, -1.0787336947006548e-06], [-6.196626502863231e-05, 7.40606874390972e-07], [-6.221996657939379e-05, -1.1253816454658483e-06], [-6.209883475840911e-05, 6.906455522378203e-07], [-6.241608318749344e-05, -1.171615562409222e-06], [-6.22683048807548e-05, 6.402689879459387e-07], [-6.26491818688762e-05, -1.2174352670603478e-06], [-6.247492095676518e-05, 5.894767335920336e-07], [-6.291952521182611e-05, -1.2628405164233077e-06], [-6.271897616073131e-05, 5.382682761598997e-07], [-6.322742379999499e-05, -1.3078310018369405e-06], [-6.300081206363113e-05, 4.866430362898774e-07], [-6.35732370640168e-05, -1.3524063476253306e-06], [-6.332081955164627e-05, 4.3460036681814107e-07], [-6.395737427023596e-05, -1.3965661095394978e-06], [-6.367943988399607e-05, 3.821395510942945e-07], [-6.438029565120988e-05, -1.4403097729858221e-06], [-6.407716589519281e-05, 3.2925980109426237e-07], [-6.48425136834161e-05, -1.4836367510154144e-06], [-6.451454334748665e-05, 2.7596025527759235e-07], [-6.534459451836434e-05, -1.5265463821080535e-06], [-6.499217244009476e-05, 2.222399762339932e-07], [-6.588715957406379e-05, -1.5690379276991532e-06], [-6.551070948258319e-05, 1.6809794807203827e-07], [-6.647088729468402e-05, -1.6111105694756762e-06], [-6.607086874070346e-05, 1.135330735471127e-07], [-6.70965150871597e-05, -1.6527634064128893e-06], [-6.667342446389013e-05, 5.854417094286078e-08], [-6.776484144445934e-05, -1.6939954515488993e-06], [-6.731921310470302e-05, 3.1299706549777975e-09], [-6.847672826633088e-05, -1.734805628489859e-06], [-6.800913574151864e-05, -5.2710888506314214e-08], [-6.923310338942046e-05, -1.775192767625172e-06], [-6.874416071706176e-05, -1.0897986331628179e-07], [-7.00349633399856e-05, -1.8151556020636275e-06], [-6.952532650659289e-05, -1.656785104704801e-07], [-7.088337632373081e-05, -1.854692763231247e-06], [-7.035374483103251e-05, -2.2280849126263599e-07], [-7.1779485468779e-05, -1.893802776178834e-06], [-7.12306040318116e-05, -2.803715766019011e-07], [-7.272451233939007e-05, -1.932484054541225e-06], [-7.215717272595529e-05, -3.3836965245531863e-07], [-7.371976073988035e-05, -1.970734895142727e-06], [-7.313480376173057e-05, -3.968047256628665e-07], [-7.47666208300329e-05, -2.0085534722552287e-06], [-7.416493849728653e-05, -4.556789302471708e-07], [-7.586657357549692e-05, -2.045937831457375e-06], [-7.524911142683533e-05, -5.149945341438543e-07], [-7.702119555902041e-05, -2.082885883134622e-06], [-7.63889551815527e-05, -5.74753946507718e-07], [-7.823216418091517e-05, -2.119395395552788e-06], [-7.758620593495172e-05, -6.349597255489307e-07], [-7.950126328007067e-05, -2.1554639875270356e-06], [-7.884270924561909e-05, -6.956145870068376e-07], [-8.083038920997532e-05, -2.1910891206860217e-06], [-8.016042637348202e-05, -7.567214132961271e-07], [-8.222155740774047e-05, -2.2262680912963643e-06], [-8.154144110946507e-05, -8.182832634260937e-07], [-8.367690949804827e-05, -2.26099802170086e-06], [-8.298796716264673e-05, -8.803033837634442e-07], [-8.519872097824807e-05, -2.2952758513263656e-06], [-8.450235615343655e-05, -9.427852197294472e-07], [-8.678940953574013e-05, -2.329098327351772e-06], [-8.608710626655284e-05, -1.0057324286313274e-06], [-8.845154405415586e-05, -2.362461995031047e-06], [-8.774487162327375e-05, -1.0691488936997963e-06], [-9.018785437088786e-05, -2.39536318776534e-06], [-8.94784724387643e-05, -1.133038739580181e-06], [-9.200124185532353e-05, -2.4277980170317546e-06], [-9.129090603755312e-05, -1.1974063495182512e-06], [-9.389479088471257e-05, -2.4597623622770854e-06], [-9.318535880819001e-05, -1.2622563845351969e-06], [-9.587178130311138e-05, -2.491251861037617e-06], [-9.516521918722219e-05, -1.3275938049806445e-06], [-9.793570195849672e-05, -2.5222618994992276e-06], [-9.723409177277224e-05, -1.3934238949306998e-06], [-0.00010009026542388495, -2.5527876039249434e-06], [-9.939581267951501e-05, -1.4597522900801381e-06], [-0.00010233942402057673, -2.5828238334325954e-06], [-0.00010165446625983818, -1.5265850098870936e-06], [-0.0001046873872753978, -2.612365174829303e-06], [-0.0001040144033306379, -1.5939284949819218e-06], [-0.0001071386409595288, -2.64140594043656e-06], [-0.0001064802610619365, -1.6617896511593802e-06], [-0.00010969796787422937, -2.669940170091854e-06], [-0.00010905698470240965, -1.7301759016026386e-06], [-0.0001123704705690241, -2.697961639048102e-06], [-0.00011174985133852225, -1.7990952495481583e-06], [-0.00011516159620093751, -2.725463873911764e-06], [-0.00011456449590858249, -1.8685563541821378e-06], [-0.00011807716376974492, -2.7524401795211966e-06], [-0.0001175069397211983, -1.938568623499279e-06], [-0.00012112339399423536, -2.7788836806645256e-06], [-0.00012058362175985753, -2.009142328892115e-06], [-0.00012430694212917762, -2.8047873837139064e-06], [-0.00012380143309241926, -2.080288747784221e-06], [-0.00012763493406227442, -2.8301442649781743e-06], [-0.00012716775474688182, -2.1520203425660672e-06], [-0.00013111500607623796, -2.854947394700529e-06], [-0.00013069049946399621, -2.224350986615247e-06], [-0.0001347553487138684, -2.8791901086252954e-06], [-0.00013437815779403803, -2.297296251637289e-06], [-0.00013856475524521902, -2.902866242787288e-06], [-0.00013823984907088388, -2.3708737749702042e-06], [-0.00014255267530669083, -2.9259704523216044e-06], [-0.00014228537787285253, -2.4451037314429057e-06], [-0.00014672927436432999, -2.948498641741193e-06], [-0.00014652529666868948, -2.520009442102349e-06], [-0.0001511054997494796, -2.9704485430106883e-06], [-0.0001509709754505768, -2.5956181624232147e-06], [-0.0001556931541268477, -2.991820489421099e-06], [-0.00015563467927710565, -2.671962106114164e-06], [-0.0001605049773860405, -3.0126184486969923e-06], [-0.0001605296547909005, -2.7490797785118944e-06], [-0.00016555473810099202, -3.032851399162605e-06], [-0.00016567022694173022, -2.827017717057569e-06], [-0.00017085733588200988, -3.0525351597461998e-06], [-0.00017107190734146354, -2.9058327674861513e-06], [-0.00017642891615710172, -3.071694819985889e-06], [-0.00017675151590733508, -2.985595065158651e-06], [-0.0001822869991692612, -3.090367963156662e-06], [-0.00018272731772148577, -3.066391945047398e-06], [-0.00018845062527145595, -3.108608937261524e-06], [-0.0001890191773556164, -3.1483330747954697e-06], [-0.00019494051894997308, -3.1264945099162113e-06], [-0.00019564873328914662, -3.2315571989328493e-06], [-0.00020177927441993997, -3.1441313502843173e-06], [-0.0002026395954990713, -3.3162410052572953e-06], [-0.00020899156612662762, -3.1616659219427325e-06], [-0.00021001756983310107, -3.4026107863115046e-06], [-0.00021660438806717322, -3.1792975557888696e-06], [-0.00021781091341078646, -3.490957781434544e-06], [-0.00022464732653736726, -3.197295715325166e-06], [-0.00022605062604926822, -3.5816583640353527e-06], [-0.00023315287172763797, -3.2160227860009174e-06], [-0.0002347707836034431, -3.675200604995562e-06], [-0.00024215677456587912, -3.235964139092921e-06], [-0.00024400892017132966, -3.7722192230754482e-06], [-0.00025169845636099003, -3.2577677693659913e-06], [-0.00025380646737507915, -3.873541561833901e-06], [-0.00026182148017318173, -3.2822965241274585e-06], [-0.00026420926042254595, -3.980248054849288e-06], [-0.0002725740944641284, -3.310696880580024e-06], [-0.00027526812242467967, -4.093751715611497e-06], [-0.0002840098615058414, -3.3444894552881817e-06], [-0.00028703954053781904, -4.215902591052692e-06], [-0.00029618838530199817, -3.3856880301833856e-06], [-0.00029958644996966056, -4.349124946202774e-06], [-0.0003091761564548532, -3.4369559650319324e-06], [-0.00031297914479169666, -4.496597328330457e-06], [-0.0003230475345552983, -3.5018115799814036e-06], [-0.00032729633790167136, -4.662488754411531e-06], [-0.0003378858923468191, -3.5848976178055795e-06], [-0.00034262639644117433, -4.852268284838829e-06], [-0.00035378495018028905, -3.6923344700733248e-06], [-0.00035906878355889896, -5.0731104561638835e-06], [-0.0003708503341949, -3.832182776970612e-06], [-0.0003767357426733693, -5.334425788064303e-06], [-0.00038920139727875383, -4.01504867251025e-06], [-0.0003957542663677178, -5.648554289959628e-06], [-0.0004089733482038515, -4.254874836231743e-06], [-0.0004162683987483409, -6.0316711236304514e-06], [-0.0004303197413766596, -4.569973251135596e-06], [-0.00043844192747186366, -6.504968029803259e-06], [-0.00045341538731269345, -4.984371942116594e-06], [-0.00046246152956003244, -7.096192681198019e-06], [-0.00047845975204404497, -5.5295689678805e-06], [-0.000488540443322762, -7.841651889988842e-06], [-0.0005056809218603692, -6.246813801651388e-06], [-0.0005169227467503476, -8.788814957481503e-06], [-0.0005353402174968136, -7.19007050431321e-06], [-0.0005478883298972455, -9.999692127196154e-06], [-0.0005677375482177238, -8.429860678555288e-06], [-0.0005817586539483677, -1.1555212209250428e-05], [-0.000603217599834028, -1.0058239441881787e-05], [-0.0006189033911627728, -1.3560885579963342e-05], [-0.0006421769495029057, -1.2195227430637973e-05], [-0.0006597480352696953, -1.6154117072195723e-05], [-0.0006850721912290439, -1.499710959553916e-05], [-0.0007047825575951714, -1.9513631529100293e-05], [-0.0007324291350671976, -1.8667121374722125e-05], [-0.0007545711551536064, -2.3871597446870895e-05], [-0.0007848531040854313, -2.3469179532197057e-05], [-0.0008097630859933108, -2.9529186331136336e-05], [-0.0008430402877192655, -2.974548401492105e-05], [-0.00087110450423559, -3.687649294102703e-05], [-0.0009077900064372468, -3.793902468562512e-05], [-0.0009394510786185188, -4.6417970785913374e-05], [-0.000980017584352602, -4.862227914172985e-05], [-0.0010157809848412203, -5.880481448649697e-05], [-0.001060767291185088, -6.253369127213284e-05], [-0.0011012075774571234, -7.487605176569727e-05], [-0.0011512244722907663, -8.062387988983572e-05], [-0.0011969906359303364, -9.571049699286347e-05], [-0.0012527254939664735, -0.00010411394523793316], [-0.0013045444936838945, -0.00012269216572506164], [-0.0013667634351439452, -0.00013456871576917625], [-0.001425440533947553, -0.00015759224898713217], [-0.0014949864812269025, -0.0001739882965135916], [-0.0015614003857181101, -0.00020267127850439264], [-0.0016391846217988528, -0.00022492181618591087], [-0.0017142745628211122, -0.0002608056411993775], [-0.0018012583899387898, -0.00029060777012498436], [-0.0018859991084645739, -0.0003356430522306461], [-0.001983160834971495, -0.0003751457267339107], [-0.0020785198407629927, -0.000431791848884583], [-0.0021868004698389586, -0.0004837042488651149], [-0.0022936697890840406, -0.0005550488210641348], [-0.002413888294156135, -0.0006227694215411763], [-0.0025329800469195856, -0.0007126694224597418], [-0.002665705807257654, -0.0008004369625977016], [-0.002797397148042099, -0.0009136820934323446], [-0.0029427627561783402, -0.0010267478757251894], [-0.003086870724126499, -0.0011692442630002525], [-0.003244302701316593, -0.0013140619756656245], [-0.0033997630849464484, -0.0014930301253699074], [-0.0035676007723203364, -0.0016774538074095552], [-0.0037320169242146973, -0.0019016275620989487], [-0.003906980708789431, -0.002135099079810153], [-0.00407599815166577, -0.002414900609627484], [-0.004252457132387499, -0.002708593022342704], [-0.004418907814999136, -0.0030562400492162014], [-0.0045878842733408235, -0.0034230993387445387], [-0.0047406310456526764, -0.0038525709466485187], [-0.004888465726519122, -0.004307160890743566], [-0.005010864761052034, -0.00483390141352315], [-0.005117455744841568, -0.0053918973849018965], [-0.005185346375184748, -0.006032064751956127], [-0.005221871378426242, -0.006709150322625474], [-0.005201008076320993, -0.007478101643789628], [-0.005127058280079552, -0.008287879113065921], [-0.004969936702083224, -0.009197410202378931], [-0.00473005616586136, -0.010147714640398695], [-0.004372192013481428, -0.01120129757386586], [-0.0038919844758640533, -0.0122879601062107], [-0.003247957444272118, -0.013472801044791278], [-0.002430303697939029, -0.014669372419120356], [-0.0013904402530421649, -0.015943459195418157], [-0.00011320262974662124, -0.017184570495762], [0.0014570091089693453, -0.01845587042124862], [0.0033385992665825415, -0.019610598595245846], [0.005591583250916492, -0.020704013208809748], [0.008230558567619988, -0.02153353998428774], [0.011311231570098368, -0.022138864939592492], [0.014825310334252864, -0.022229319799413522], [0.01880047434989794, -0.02182007552956377], [0.02315441756977442, -0.02047537366480261], [0.027823220621155314, -0.018185010962453854], [0.032491564738123625, -0.014248963560884384], [0.03681929809400242, -0.008708872238756146], [0.03937195143028251, 0.0], [0.03681929809400242, 0.008708872238756148], [0.03249156473812363, 0.014248963560884384], [0.02782322062115532, 0.018185010962453854], [0.023154417569774426, 0.02047537366480261], [0.018800474349897945, 0.02182007552956377], [0.014825310334252864, 0.022229319799413526], [0.01131123157009837, 0.022138864939592492], [0.008230558567619988, 0.02153353998428774], [0.005591583250916493, 0.020704013208809748], [0.0033385992665825423, 0.019610598595245842], [0.0014570091089693455, 0.01845587042124862], [-0.00011320262974661994, 0.017184570495762008], [-0.0013904402530421625, 0.015943459195418154], [-0.002430303697939028, 0.01466937241912036], [-0.003247957444272117, 0.013472801044791278], [-0.0038919844758640515, 0.0122879601062107], [-0.004372192013481429, 0.01120129757386586], [-0.004730056165861361, 0.010147714640398696], [-0.0049699367020832235, 0.009197410202378933], [-0.005127058280079553, 0.00828787911306592], [-0.005201008076320992, 0.007478101643789629], [-0.005221871378426241, 0.006709150322625476], [-0.005185346375184747, 0.006032064751956127], [-0.005117455744841568, 0.005391897384901895], [-0.005010864761052033, 0.00483390141352315], [-0.0048884657265191225, 0.004307160890743564], [-0.0047406310456526764, 0.0038525709466485187], [-0.00458788427334082, 0.0034230993387445387], [-0.004418907814999135, 0.0030562400492161993], [-0.004252457132387497, 0.002708593022342703], [-0.004075998151665769, 0.0024149006096274837], [-0.003906980708789431, 0.002135099079810152], [-0.0037320169242146973, 0.00190162756209895], [-0.003567600772320337, 0.0016774538074095582], [-0.003399763084946448, 0.001493030125369906], [-0.003244302701316592, 0.0013140619756656258], [-0.0030868707241264995, 0.0011692442630002538], [-0.00294276275617834, 0.0010267478757251902], [-0.002797397148042099, 0.0009136820934323462], [-0.002665705807257654, 0.0008004369625977042], [-0.002532980046919586, 0.0007126694224597467], [-0.0024138882941561347, 0.000622769421541178], [-0.002293669789084042, 0.0005550488210641353], [-0.002186800469838959, 0.0004837042488651164], [-0.0020785198407629927, 0.000431791848884584], [-0.001983160834971496, 0.00037514572673391275], [-0.001885999108464575, 0.00033564305223064716], [-0.0018012583899387903, 0.0002906077701249873], [-0.0017142745628211144, 0.00026080564119937525], [-0.0016391846217988569, 0.00022492181618591413], [-0.0015614003857181127, 0.00020267127850439156], [-0.0014949864812269, 0.00017398829651359162], [-0.0014254405339475542, 0.0001575922489871324], [-0.0013667634351439452, 0.00013456871576917625], [-0.0013045444936838951, 0.00012269216572506292], [-0.0012527254939664737, 0.00010411394523793348], [-0.0011969906359303346, 9.57104969928641e-05], [-0.0011512244722907653, 8.062387988983537e-05], [-0.0011012075774571226, 7.487605176569668e-05], [-0.0010607672911850867, 6.25336912721342e-05], [-0.0010157809848412196, 5.88048144864967e-05], [-0.0009800175843526012, 4.862227914172985e-05], [-0.0009394510786185178, 4.641797078591388e-05], [-0.0009077900064372472, 3.7939024685625584e-05], [-0.0008711045042355896, 3.6876492941026814e-05], [-0.0008430402877192656, 2.974548401492075e-05], [-0.0008097630859933103, 2.952918633113796e-05], [-0.0007848531040854308, 2.346917953219718e-05], [-0.0007545711551536062, 2.387159744687211e-05], [-0.0007324291350671954, 1.866712137472383e-05], [-0.0007047825575951714, 1.9513631529101184e-05], [-0.0006850721912290444, 1.499710959553897e-05], [-0.0006597480352696951, 1.615411707219575e-05], [-0.000642176949502906, 1.219522743063712e-05], [-0.0006189033911627724, 1.3560885579962043e-05], [-0.0006032175998340274, 1.0058239441882424e-05], [-0.0005817586539483687, 1.1555212209250604e-05], [-0.0005677375482177235, 8.429860678554705e-06], [-0.0005478883298972452, 9.999692127198177e-06], [-0.0005353402174968143, 7.190070504314644e-06], [-0.0005169227467503476, 8.788814957481503e-06], [-0.0005056809218603664, 6.2468138016537015e-06], [-0.0004885404433227598, 7.841651889989484e-06], [-0.0004784597520440439, 5.5295689678828135e-06], [-0.0004624615295600322, 7.096192681199737e-06], [-0.00045341538731269345, 4.984371942118935e-06], [-0.00043844192747186485, 6.50496802980261e-06], [-0.0004303197413766595, 4.569973251137531e-06], [-0.0004162683987483396, 6.0316711236316415e-06], [-0.00040897334820385044, 4.254874836232825e-06], [-0.00039575426636771836, 5.648554289960521e-06], [-0.00038920139727875367, 4.015048672511954e-06], [-0.00037673574267336915, 5.334425788067117e-06], [-0.0003708503341948996, 3.832182776969057e-06], [-0.0003590687835588988, 5.073110456166643e-06], [-0.00035378495018028943, 3.692334470073352e-06], [-0.00034262639644117433, 4.852268284839181e-06], [-0.0003378858923468203, 3.5848976178064045e-06], [-0.0003272963379016714, 4.662488754411653e-06], [-0.0003230475345552987, 3.5018115799826076e-06], [-0.0003129791447916976, 4.496597328329646e-06], [-0.0003091761564548547, 3.436955965033055e-06], [-0.0002995864499696609, 4.349124946204086e-06], [-0.0002961883853019999, 3.3856880301856713e-06], [-0.0002870395405378193, 4.215902591051907e-06], [-0.0002840098615058429, 3.3444894552892366e-06], [-0.00027526812242468026, 4.093751715611822e-06], [-0.0002725740944641284, 3.310696880580024e-06], [-0.0002642092604225458, 3.980248054846915e-06], [-0.00026182148017317767, 3.282296524126187e-06], [-0.00025380646737507834, 3.873541561835186e-06], [-0.00025169845636098737, 3.2577677693657885e-06], [-0.00024400892017132793, 3.77221922307814e-06], [-0.00024215677456587844, 3.235964139094206e-06], [-0.00023477078360344307, 3.675200604997266e-06], [-0.00023315287172763656, 3.216022786002473e-06], [-0.00022605062604926884, 3.5816583640370705e-06], [-0.00022464732653736694, 3.1972957153268837e-06], [-0.00021781091341078598, 3.49095778143706e-06], [-0.00021660438806717262, 3.1792975557894647e-06], [-0.00021001756983310155, 3.4026107863130462e-06], [-0.00020899156612662887, 3.161665921942922e-06], [-0.00020263959549907164, 3.3162410052585124e-06], [-0.00020177927441994073, 3.1441313502858864e-06], [-0.00019564873328914634, 3.2315571989339043e-06], [-0.0001949405189499738, 3.126494509917104e-06], [-0.000189019177355617, 3.148333074795605e-06], [-0.0001884506252714573, 3.1086089372642564e-06], [-0.00018272731772148504, 3.066391945047263e-06], [-0.00018228699916926264, 3.0903679631573385e-06], [-0.00017675151590733606, 2.985595065158096e-06], [-0.0001764289161571033, 3.0716948199852125e-06], [-0.000171071907341465, 2.9058327674861378e-06], [-0.0001708573358820127, 3.052535159745591e-06], [-0.00016567022694173022, 2.827017717057569e-06], [-0.0001655547381009904, 3.0328513991637075e-06], [-0.00016052965479089926, 2.749079778511191e-06], [-0.00016050497738603754, 3.012618448697398e-06], [-0.0001556346792771053, 2.6719621061168558e-06], [-0.0001556931541268467, 2.991820489423182e-06], [-0.00015097097545057673, 2.595618162425406e-06], [-0.00015110549974947914, 2.9704485430113646e-06], [-0.00014652529666868958, 2.5200094421037558e-06], [-0.00014672927436432952, 2.948498641741139e-06], [-0.00014228537787285207, 2.4451037314440686e-06], [-0.0001425526753066898, 2.9259704523224163e-06], [-0.00013823984907088382, 2.370873774971611e-06], [-0.0001385647552452186, 2.9028662427881264e-06], [-0.0001343781577940384, 2.2972962516378574e-06], [-0.00013475534871386846, 2.879190108627162e-06], [-0.00013069049946399573, 2.2243509866160315e-06], [-0.00013111500607623788, 2.8549473947012054e-06], [-0.00012716775474688266, 2.1520203425677177e-06], [-0.00012763493406227585, 2.8301442649814205e-06], [-0.00012380143309242012, 2.0802887477853573e-06], [-0.0001243069421291785, 2.804787383716936e-06], [-0.00012058362175985799, 2.0091423288927644e-06], [-0.00012112339399423543, 2.7788836806651206e-06], [-0.00011750693972119993, 1.9385686234999825e-06], [-0.00011807716376974592, 2.7524401795207638e-06], [-0.00011456449590858408, 1.86855635418113e-06], [-0.00011516159620093751, 2.725463873911764e-06], [-0.00011174985133852244, 1.799095249547279e-06], [-0.00011237047056902294, 2.6979616390494546e-06], [-0.00010905698470240971, 1.7301759016035314e-06], [-0.00010969796787422993, 2.669940170091773e-06], [-0.00010648026106193534, 1.6617896511588123e-06], [-0.00010713864095952848, 2.64140594043629e-06], [-0.00010401440333063671, 1.5939284949823006e-06], [-0.00010468738727539712, 2.6123651748310074e-06], [-0.00010165446625983766, 1.5265850098876347e-06], [-0.00010233942402057664, 2.582823833430485e-06], [-9.939581267951553e-05, 1.459752290081085e-06], [-0.00010009026542388593, 2.5527876039243755e-06], [-9.723409177277126e-05, 1.3934238949312409e-06], [-9.793570195849565e-05, 2.522261899499985e-06], [-9.516521918722202e-05, 1.3275938049815913e-06], [-9.587178130310997e-05, 2.4912518610368056e-06], [-9.318535880819103e-05, 1.2622563845377399e-06], [-9.389479088471212e-05, 2.459762362277302e-06], [-9.129090603755363e-05, 1.197406349517115e-06], [-9.200124185532617e-05, 2.427798017030997e-06], [-8.947847243876667e-05, 1.1330387395806678e-06], [-9.018785437088903e-05, 2.3953631877665842e-06], [-8.774487162327556e-05, 1.0691488937003102e-06], [-8.845154405415655e-05, 2.3624619950298564e-06], [-8.60871062665535e-05, 1.0057324286320306e-06], [-8.678940953574054e-05, 2.3290983273509675e-06], [-8.450235615343655e-05, 9.427852197294472e-07], [-8.519872097824718e-05, 2.2952758513275155e-06], [-8.29879671626462e-05, 8.803033837624432e-07], [-8.367690949804935e-05, 2.2609980217006165e-06], [-8.154144110946418e-05, 8.182832634276627e-07], [-8.222155740774148e-05, 2.2262680912988533e-06], [-8.016042637348061e-05, 7.567214132972092e-07], [-8.083038920997459e-05, 2.191089120686833e-06], [-7.884270924562115e-05, 6.956145870071081e-07], [-7.950126328007131e-05, 2.1554639875281715e-06], [-7.758620593494996e-05, 6.349597255507702e-07], [-7.823216418091481e-05, 2.1193953955534373e-06], [-7.638895518155161e-05, 5.74753946508719e-07], [-7.702119555901941e-05, 2.082885883135515e-06], [-7.52491114268368e-05, 5.149945341439895e-07], [-7.58665735754959e-05, 2.04593783145751e-06], [-7.416493849728653e-05, 4.5567893024922674e-07], [-7.476662083003324e-05, 2.008553472253524e-06], [-7.31348037617311e-05, 3.9680472566457077e-07], [-7.371976073988156e-05, 1.9707348951455945e-06], [-7.215717272595518e-05, 3.3836965245434475e-07], [-7.272451233938931e-05, 1.9324840545410085e-06], [-7.123060403181427e-05, 2.803715766043358e-07], [-7.177948546877861e-05, 1.8938027761769673e-06], [-7.035374483103272e-05, 2.228084912635287e-07], [-7.088337632373428e-05, 1.8546927632315446e-06], [-6.952532650659217e-05, 1.6567851047171096e-07], [-7.00349633399856e-05, 1.8151556020636275e-06], [-6.874416071706072e-05, 1.0897986331393501e-07], [-6.923310338941794e-05, 1.7751927676263081e-06], [-6.800913574151765e-05, 5.271088850655769e-08], [-6.847672826633037e-05, 1.7348056284881817e-06], [-6.731921310470143e-05, -3.129970654058022e-09], [-6.776484144445953e-05, 1.6939954515500085e-06], [-6.667342446389103e-05, -5.8544170943023094e-08], [-6.709651508715809e-05, 1.6527634064140256e-06], [-6.6070868740703e-05, -1.1353307354746438e-07], [-6.647088729468459e-05, 1.6111105694751082e-06], [-6.551070948258321e-05, -1.6809794807149723e-07], [-6.588715957406512e-05, 1.5690379276997754e-06], [-6.499217244009545e-05, -2.222399762333169e-07], [-6.534459451836339e-05, 1.5265463821100283e-06], [-6.45145433474875e-05, -2.7596025527645616e-07], [-6.484251368341541e-05, 1.4836367510151169e-06], [-6.407716589519217e-05, -3.292598010912596e-07], [-6.438029565120952e-05, 1.4403097729865525e-06], [-6.367943988399752e-05, -3.821395510934829e-07], [-6.395737427023595e-05, 1.3965661095412563e-06], [-6.33208195516476e-05, -4.346003668159769e-07], [-6.357323706401662e-05, 1.3524063476248166e-06], [-6.300081206363377e-05, -4.866430362884437e-07], [-6.322742379999576e-05, 1.3078310018379143e-06], [-6.27189761607319e-05, -5.382682761598186e-07], [-6.291952521182793e-05, 1.2628405164254583e-06], [-6.247492095676518e-05, -5.894767335920336e-07], [-6.26491818688752e-05, 1.217435267060206e-06], [-6.226830488075273e-05, -6.402689879452354e-07], [-6.241608318749378e-05, 1.1716155624102499e-06], [-6.209883475840671e-05, -6.906455522363054e-07], [-6.221996657939299e-05, 1.125381645466687e-06], [-6.196626502863209e-05, -7.406068743903498e-07], [-6.206061673305709e-05, 1.078733694702359e-06], [-6.187039709126795e-05, -7.901533382780979e-07], [-6.193786502482446e-05, 1.0316718249995955e-06], [-6.181107878306702e-05, -8.392852645668564e-07], [-6.185158905688148e-05, 9.841960883923635e-07], [-6.178820397942791e-05, -8.880029113487167e-07], [-6.180171231999293e-05, 9.363064745960591e-07]]
In [7]:
print(json.dumps(list(map(lambda x: x.real, firr))))
[-0.0001236034246399853, -0.00012357640795885672, -0.00012370317811376385, -0.0001236221575661367, -0.00012387573004965028, -0.00012374079418253224, -0.00012412123346611568, -0.00012393253005726462, -0.00012443993315878758, -0.00012419766951681822, -0.00012483216637498688, -0.0001245366097615096, -0.0001252983637377524, -0.00012494984191353036, -0.00012583905042365222, -0.00012543795232146263, -0.00012645484759998997, -0.00012600162412726226, -0.0001271464741280336, -0.00012664163910329254, -0.00012791474854047193, -0.00012735887976799215, -0.00012876059130241977, -0.00012815433179038562, -0.0001296850273668322, -0.0001290290866949733, -0.00013068918903672868, -0.00012998434488018952, -0.00013177431914812758, -0.00013102141896516637, -0.00013294177458936804, -0.00013214173748140692, -0.0001341930301743194, -0.00013334684892778027, -0.00013552968288891868, -0.00013463842620940603, -0.00013695345653266176, -0.0001360182714830373, -0.00013846620677884092, -0.00013748832143412352, -0.0001400699266799712, -0.00013905065301318578, -0.00014176675264746162, -0.00014070748966206503, -0.000143558970937558, -0.0001424612080636232, -0.00014544902467878015, -0.00014431434545191058, -0.0001474395214797607, -0.00014626960752346115, -0.0001495332416600658, -0.00014832987699457307, -0.00015173314715099384, -0.00015049822285367065, -0.00015404239111804083, -0.0001527779103631054, -0.00015646432836183033, -0.00015517241186990344, -0.00015900252656014135, -0.00015768541849123818, -0.00016166077841995064, -0.00016032085274696403, -0.00016444311481548095, -0.00016308288221893015, -0.00016735381899609655, -0.00016597593432529347, -0.00017039744195649614, -0.0001690047123068731, -0.00017357881907148026, -0.00017217421253310568, -0.00017690308810831173, -0.0001754897432465475, -0.00018037570874177572, -0.0001789569448775286, -0.00018400248371064706, -0.00018258181207510624, -0.00018778958176942514, -0.00018637071761638002, -0.00019174356260622276, -0.00019033043837444439, -0.00019587140391699343, -0.00019446818354554448, -0.0002001805308477699, -0.00019879162535903002, -0.00020467884804115346, -0.00020330893251967636, -0.0002093747745507956, -0.0002080288066612758, -0.0002142772819190576, -0.000212960522123873, -0.00021939593574845875, -0.0002181139694048193, -0.0002247409411380482, -0.0002234997026770445, -0.00023032319240187503, -0.00022912899181716498, -0.00023615432753948984, -0.0002350138794423966, -0.00024224678798847072, -0.00024116724351971506, -0.00024861388425835525, -0.0002476028661848385, -0.00025526986812454884, -0.00025433550949376365, -0.0002622300121524759, -0.00026138099892799243, -0.0002695106974277368, -0.00026875631558807606, -0.00027712951049043804, -0.00027647969814176775, -0.00028510535061338166, -0.00028457075574570505, -0.00029345854872865997, -0.00029305059333737895, -0.0003022109994989592, -0.0003019419509011536, -0.0003113863082536954, -0.0003112693585542113, -0.000321009954772081, -0.000321059309581801, -0.00033110947620198405, -0.00033134045388346045, -0.00034171467176401975, -0.00034214381468292707, -0.00035285783231420344, -0.00035350303181467017, -0.0003645739983385224, -0.00036545463544297154, -0.0003769012505429119, -0.0003780383547112328, -0.00038988103789994616, -0.00039129746657829323, -0.00040355854883987994, -0.0004052791909981426, -0.00041798313225325525, -0.00042003513966620213, -0.00043320877613434644, -0.00043562182682157293, -0.0004492946530747345, -0.00045210125209853644, -0.00046630574345527594, -0.0004695415672068862, -0.00048431354913175824, -0.0004880178403426593, -0.0005033969127219801, -0.0005076129347501583, -0.0005236429603463635, -0.0005284185208450919, -0.0005451481889282568, -0.0005505362448493593, -0.0005680197230116828, -0.0005740790810756381, -0.0005923767706039963, -0.0005991728999393211, -0.0006183523129097064, -0.0006259582895833933, -0.0006460950691105967, -0.0006545926758033427, -0.0006757717846936382, -0.0006852527928823487, -0.0007075699003605781, -0.0007181375671177979, -0.0007417006683898, -0.0007534714853467386, -0.0007784027945575077, -0.0007915085327354356, -0.000817946696407703, -0.0008325367974966818, -0.0008606394827533192, -0.0008768838549437273, -0.0009068307746253869, -0.0009249230591200649, -0.0009569195040880899, -0.000977080886645524, -0.0010113618437207384, -0.0010338454935006952, -0.0010706804349936271, -0.001095776659794491, -0.0011354750964354477, -0.0011635173078967354, -0.001206435199668056, -0.0012378067823255456, -0.0012843538990058114, -0.0013194960705393906, -0.0013701443824580878, -0.0014095651151903427, -0.0014648582701343952, -0.0015091423103072129, -0.0015697062081708626, -0.0016195261719866216, -0.001686080575438531, -0.00174220900847118, -0.0018155800128744936, -0.0018789021572370376, -0.001960035168705204, -0.0020315619696824406, -0.002121534582370176, -0.002202415154914247, -0.0023024489445815327, -0.0023939812718606727, -0.002505450987932947, -0.002609088987367789, -0.0027335268702878904, -0.002850881067895106, -0.002989972962453805, -0.0031228007714362203, -0.0032783692435977055, -0.0034285491256422244, -0.0036025167798775797, -0.0037719982169291478, -0.00396632166994299, -0.004157039681525985, -0.004373600939677917, -0.004587339578168081, -0.00482777658831227, -0.005065960093839171, -0.005331411614515308, -0.005594794296084198, -0.0058855255123566805, -0.006173741448252998, -0.006488605402633186, -0.006799526169892897, -0.007135201544640673, -0.007464033848429395, -0.007813961417578862, -0.00815199630333154, -0.008504914264774998, -0.008837815629998271, -0.009175768546681647, -0.009481262091305353, -0.009776931453038243, -0.010021729522104068, -0.010234911489683135, -0.010370692750369497, -0.010443742756852484, -0.010402016152641986, -0.010254116560159104, -0.009939873404166449, -0.00946011233172272, -0.008744384026962856, -0.0077839689517281065, -0.006495914888544236, -0.004860607395878058, -0.0027808805060843297, -0.00022640525949324248, 0.0029140182179386905, 0.006677198533165083, 0.011183166501832984, 0.016461117135239976, 0.022622463140196735, 0.02965062066850573, 0.03760094869979588, 0.04630883513954884, 0.05564644124231063, 0.06498312947624725, 0.07363859618800483, 0.07874390286056503, 0.07363859618800483, 0.06498312947624726, 0.05564644124231064, 0.04630883513954885, 0.03760094869979589, 0.02965062066850573, 0.02262246314019674, 0.016461117135239976, 0.011183166501832986, 0.006677198533165085, 0.002914018217938691, -0.00022640525949323988, -0.002780880506084325, -0.004860607395878056, -0.006495914888544234, -0.007783968951728103, -0.008744384026962858, -0.009460112331722722, -0.009939873404166447, -0.010254116560159105, -0.010402016152641984, -0.010443742756852482, -0.010370692750369495, -0.010234911489683135, -0.010021729522104067, -0.009776931453038245, -0.009481262091305353, -0.00917576854668164, -0.00883781562999827, -0.008504914264774994, -0.008151996303331539, -0.007813961417578862, -0.007464033848429395, -0.007135201544640674, -0.006799526169892896, -0.006488605402633184, -0.006173741448252999, -0.00588552551235668, -0.005594794296084198, -0.005331411614515308, -0.005065960093839172, -0.004827776588312269, -0.004587339578168084, -0.004373600939677918, -0.004157039681525985, -0.003966321669942992, -0.00377199821692915, -0.0036025167798775805, -0.0034285491256422287, -0.0032783692435977138, -0.0031228007714362255, -0.0029899729624538, -0.0028508810678951084, -0.0027335268702878904, -0.0026090889873677903, -0.0025054509879329475, -0.0023939812718606693, -0.0023024489445815305, -0.002202415154914245, -0.0021215345823701734, -0.0020315619696824392, -0.0019600351687052023, -0.0018789021572370357, -0.0018155800128744945, -0.0017422090084711793, -0.0016860805754385312, -0.0016195261719866205, -0.0015697062081708615, -0.0015091423103072124, -0.0014648582701343909, -0.0014095651151903427, -0.0013701443824580889, -0.0013194960705393902, -0.001284353899005812, -0.0012378067823255448, -0.0012064351996680547, -0.0011635173078967374, -0.001135475096435447, -0.0010957766597944904, -0.0010706804349936286, -0.0010338454935006952, -0.0010113618437207327, -0.0009770808866455196, -0.0009569195040880878, -0.0009249230591200644, -0.0009068307746253869, -0.0008768838549437297, -0.000860639482753319, -0.0008325367974966792, -0.0008179466964077009, -0.0007915085327354367, -0.0007784027945575073, -0.0007534714853467383, -0.0007417006683897992, -0.0007181375671177976, -0.0007075699003605789, -0.0006852527928823487, -0.0006757717846936406, -0.0006545926758033428, -0.0006460950691105974, -0.0006259582895833952, -0.0006183523129097094, -0.0005991728999393218, -0.0005923767706039998, -0.0005740790810756386, -0.0005680197230116858, -0.0005505362448493605, -0.0005451481889282568, -0.0005284185208450916, -0.0005236429603463553, -0.0005076129347501567, -0.0005033969127219747, -0.00048801784034265585, -0.0004843135491317569, -0.00046954156720688614, -0.0004663057434552731, -0.0004521012520985377, -0.00044929465307473387, -0.00043562182682157195, -0.00043320877613434525, -0.0004200351396662031, -0.00041798313225325774, -0.0004052791909981433, -0.00040355854883988146, -0.0003912974665782927, -0.0003898810378999476, -0.000378038354711234, -0.0003769012505429146, -0.0003654546354429701, -0.0003645739983385253, -0.0003535030318146721, -0.0003528578323142066, -0.00034214381468293, -0.0003417146717640254, -0.00033134045388346045, -0.0003311094762019808, -0.0003210593095817985, -0.00032100995477207507, -0.0003112693585542106, -0.0003113863082536934, -0.00030194195090115346, -0.0003022109994989583, -0.00029305059333737917, -0.00029345854872865905, -0.00028457075574570413, -0.0002851053506133796, -0.00027647969814176764, -0.0002771295104904372, -0.0002687563155880768, -0.0002695106974277369, -0.00026138099892799145, -0.00026223001215247576, -0.00025433550949376533, -0.0002552698681245517, -0.00024760286618484025, -0.000248613884258357, -0.00024116724351971598, -0.00024224678798847086, -0.00023501387944239985, -0.00023615432753949184, -0.00022912899181716815, -0.00023032319240187503, -0.00022349970267704488, -0.00022474094113804588, -0.00021811396940481941, -0.00021939593574845986, -0.0002129605221238707, -0.00021427728191905697, -0.00020802880666127342, -0.00020937477455079423, -0.00020330893251967533, -0.00020467884804115327, -0.00019879162535903105, -0.00020018053084777185, -0.00019446818354554253, -0.0001958714039169913, -0.00019033043837444403, -0.00019174356260621994, -0.00018637071761638205, -0.00018778958176942425, -0.00018258181207510727, -0.00018400248371065235, -0.00017895694487753334, -0.00018037570874177806, -0.0001754897432465511, -0.0001769030881083131, -0.000172174212533107, -0.00017357881907148107, -0.0001690047123068731, -0.00017039744195649435, -0.0001659759343252924, -0.0001673538189960987, -0.00016308288221892836, -0.00016444311481548295, -0.00016032085274696122, -0.00016166077841994918, -0.0001576854184912423, -0.00015900252656014262, -0.00015517241186989992, -0.00015646432836182963, -0.00015277791036310322, -0.00015404239111803882, -0.0001504982228536736, -0.0001517331471509918, -0.00014832987699457307, -0.00014953324166006648, -0.0001462696075234622, -0.00014743952147976312, -0.00014431434545191036, -0.00014544902467877863, -0.00014246120806362853, -0.00014355897093755723, -0.00014070748966206543, -0.00014176675264746856, -0.00013905065301318434, -0.0001400699266799712, -0.00013748832143412143, -0.00013846620677883587, -0.0001360182714830353, -0.00013695345653266073, -0.00013463842620940286, -0.00013552968288891906, -0.00013334684892778205, -0.00013419303017431618, -0.000132141737481406, -0.00013294177458936918, -0.00013102141896516642, -0.00013177431914813023, -0.0001299843448801909, -0.00013068918903672678, -0.000129029086694975, -0.00012968502736683082, -0.00012815433179038434, -0.00012876059130241904, -0.00012735887976799505, -0.0001279147485404719, -0.0001266416391032952, -0.00012714647412803324, -0.00012600162412726754, -0.00012645484759999152, -0.0001254379523214638, -0.00012583905042365585, -0.00012494984191353036, -0.0001252983637377504, -0.00012453660976150546, -0.00012483216637498756, -0.00012419766951681343, -0.00012443993315878598, -0.00012393253005726419, -0.00012412123346611418, -0.0001237407941825359, -0.00012387573004964892, -0.00012362215756613404, -0.00012370317811376296, -0.00012357640795885582, -0.00012360342463998587]
In [ ]:
 
In [ ]: