{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":70203,"databundleVersionId":8068726,"sourceType":"competition"}],"dockerImageVersionId":30684,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-04-19T04:24:18.344411Z","iopub.execute_input":"2024-04-19T04:24:18.345318Z","iopub.status.idle":"2024-04-19T04:24:21.303865Z","shell.execute_reply.started":"2024-04-19T04:24:18.345275Z","shell.execute_reply":"2024-04-19T04:24:21.302608Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"metadata = pd.read_csv('/kaggle/input/birdclef-2024/train_metadata.csv')\nmetadata.head()","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:24:21.307395Z","iopub.execute_input":"2024-04-19T04:24:21.308417Z","iopub.status.idle":"2024-04-19T04:24:21.523665Z","shell.execute_reply.started":"2024-04-19T04:24:21.308376Z","shell.execute_reply":"2024-04-19T04:24:21.522408Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"metadata.info()","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:24:21.525214Z","iopub.execute_input":"2024-04-19T04:24:21.525691Z","iopub.status.idle":"2024-04-19T04:24:21.580409Z","shell.execute_reply.started":"2024-04-19T04:24:21.525648Z","shell.execute_reply":"2024-04-19T04:24:21.578961Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(max(metadata['latitude']))\nprint(min(metadata['latitude']))\n\n\nprint(max(metadata['longitude']))\nprint(min(metadata['longitude']))","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:25:28.188610Z","iopub.execute_input":"2024-04-19T04:25:28.189053Z","iopub.status.idle":"2024-04-19T04:25:28.214585Z","shell.execute_reply.started":"2024-04-19T04:25:28.189022Z","shell.execute_reply":"2024-04-19T04:25:28.213137Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Label","metadata":{}},{"cell_type":"code","source":"metadata['primary_label'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:25:32.104596Z","iopub.execute_input":"2024-04-19T04:25:32.105090Z","iopub.status.idle":"2024-04-19T04:25:32.120262Z","shell.execute_reply.started":"2024-04-19T04:25:32.105058Z","shell.execute_reply":"2024-04-19T04:25:32.118892Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"metadata['secondary_labels'].value_counts()","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:25:32.293023Z","iopub.execute_input":"2024-04-19T04:25:32.293410Z","iopub.status.idle":"2024-04-19T04:25:32.307978Z","shell.execute_reply.started":"2024-04-19T04:25:32.293382Z","shell.execute_reply":"2024-04-19T04:25:32.306604Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20, 6))\nlabel_counts = metadata['primary_label'].value_counts()\n\nsns.barplot(x=label_counts.index, y=label_counts.values)\nplt.xticks(rotation=90)\n\nplt.title('Distribution of Bird Species')\nplt.xlabel('Bird Species')\nplt.ylabel('Count')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:26:18.230639Z","iopub.execute_input":"2024-04-19T04:26:18.231044Z","iopub.status.idle":"2024-04-19T04:26:20.383966Z","shell.execute_reply.started":"2024-04-19T04:26:18.231017Z","shell.execute_reply":"2024-04-19T04:26:20.383030Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"label_counts","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:26:20.385855Z","iopub.execute_input":"2024-04-19T04:26:20.386436Z","iopub.status.idle":"2024-04-19T04:26:20.395060Z","shell.execute_reply.started":"2024-04-19T04:26:20.386408Z","shell.execute_reply":"2024-04-19T04:26:20.394154Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"filtered_label_counts = label_counts[(label_counts != 500) & (label_counts >= 100)]\nfiltered_label_counts","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:26:20.396354Z","iopub.execute_input":"2024-04-19T04:26:20.397156Z","iopub.status.idle":"2024-04-19T04:26:20.411681Z","shell.execute_reply.started":"2024-04-19T04:26:20.397125Z","shell.execute_reply":"2024-04-19T04:26:20.410441Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"bird_taxonomy = pd.read_csv('/kaggle/input/birdclef-2024/eBird_Taxonomy_v2021.csv')\nbird_taxonomy","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:26:43.423829Z","iopub.execute_input":"2024-04-19T04:26:43.424227Z","iopub.status.idle":"2024-04-19T04:26:43.527117Z","shell.execute_reply.started":"2024-04-19T04:26:43.424198Z","shell.execute_reply":"2024-04-19T04:26:43.526000Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import librosa\nfrom librosa import display\nfrom IPython.display import Audio","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:27:00.453650Z","iopub.execute_input":"2024-04-19T04:27:00.454789Z","iopub.status.idle":"2024-04-19T04:27:00.488060Z","shell.execute_reply.started":"2024-04-19T04:27:00.454745Z","shell.execute_reply":"2024-04-19T04:27:00.486977Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"figure = plt.figure(figsize=(16, 5))\n\n\naudio_speech, rate = librosa.load('/kaggle/input/birdclef-2024/train_audio/asbfly/XC134896.ogg')\n\nlibrosa.display.waveshow(audio_speech, sr=rate)\n\n\nAudio(audio_speech, rate=rate)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:27:00.603990Z","iopub.execute_input":"2024-04-19T04:27:00.604700Z","iopub.status.idle":"2024-04-19T04:27:14.460897Z","shell.execute_reply.started":"2024-04-19T04:27:00.604657Z","shell.execute_reply":"2024-04-19T04:27:14.459557Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def audio_wave(file_path):\n    audio_speech, rate = librosa.load(file_path)\n    \n    duration = len(audio_speech) / rate\n\n    time = np.arange(0, duration, 1/rate)\n    plt.figure(figsize=(30, 10))\n    librosa.display.waveshow(audio_speech, sr=rate)\n    return audio_speech, rate\n","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:27:14.462912Z","iopub.execute_input":"2024-04-19T04:27:14.463452Z","iopub.status.idle":"2024-04-19T04:27:14.470465Z","shell.execute_reply.started":"2024-04-19T04:27:14.463420Z","shell.execute_reply":"2024-04-19T04:27:14.469001Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"audio_speech, rate =audio_wave('/kaggle/input/birdclef-2024/train_audio/asbfly/XC134896.ogg')","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:27:14.471621Z","iopub.execute_input":"2024-04-19T04:27:14.472034Z","iopub.status.idle":"2024-04-19T04:27:15.277949Z","shell.execute_reply.started":"2024-04-19T04:27:14.472002Z","shell.execute_reply":"2024-04-19T04:27:15.276816Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(audio_speech)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:27:15.279934Z","iopub.execute_input":"2024-04-19T04:27:15.280323Z","iopub.status.idle":"2024-04-19T04:27:15.286340Z","shell.execute_reply.started":"2024-04-19T04:27:15.280282Z","shell.execute_reply":"2024-04-19T04:27:15.285114Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(rate)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:39:12.791539Z","iopub.execute_input":"2024-04-19T04:39:12.792340Z","iopub.status.idle":"2024-04-19T04:39:12.799015Z","shell.execute_reply.started":"2024-04-19T04:39:12.792304Z","shell.execute_reply":"2024-04-19T04:39:12.797998Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Spectogram","metadata":{}},{"cell_type":"code","source":"turbo_data = [[[0.18995, 0.07176, 0.23217],\n               [0.19483, 0.08339, 0.26149],\n               [0.19956, 0.09498, 0.29024],\n               [0.20415, 0.10652, 0.31844],\n               [0.20860, 0.11802, 0.34607],\n               [0.21291, 0.12947, 0.37314],\n               [0.21708, 0.14087, 0.39964],\n               [0.22111, 0.15223, 0.42558],\n               [0.22500, 0.16354, 0.45096],\n               [0.22875, 0.17481, 0.47578],\n               [0.23236, 0.18603, 0.50004],\n               [0.23582, 0.19720, 0.52373],\n               [0.23915, 0.20833, 0.54686],\n               [0.24234, 0.21941, 0.56942],\n               [0.24539, 0.23044, 0.59142],\n               [0.24830, 0.24143, 0.61286],\n               [0.25107, 0.25237, 0.63374],\n               [0.25369, 0.26327, 0.65406],\n               [0.25618, 0.27412, 0.67381],\n               [0.25853, 0.28492, 0.69300],\n               [0.26074, 0.29568, 0.71162],\n               [0.26280, 0.30639, 0.72968],\n               [0.26473, 0.31706, 0.74718],\n               [0.26652, 0.32768, 0.76412],\n               [0.26816, 0.33825, 0.78050],\n               [0.26967, 0.34878, 0.79631],\n               [0.27103, 0.35926, 0.81156],\n               [0.27226, 0.36970, 0.82624],\n               [0.27334, 0.38008, 0.84037],\n               [0.27429, 0.39043, 0.85393],\n               [0.27509, 0.40072, 0.86692],\n               [0.27576, 0.41097, 0.87936],\n               [0.27628, 0.42118, 0.89123],\n               [0.27667, 0.43134, 0.90254],\n               [0.27691, 0.44145, 0.91328],\n               [0.27701, 0.45152, 0.92347],\n               [0.27698, 0.46153, 0.93309],\n               [0.27680, 0.47151, 0.94214],\n               [0.27648, 0.48144, 0.95064],\n               [0.27603, 0.49132, 0.95857],\n               [0.27543, 0.50115, 0.96594],\n               [0.27469, 0.51094, 0.97275],\n               [0.27381, 0.52069, 0.97899],\n               [0.27273, 0.53040, 0.98461],\n               [0.27106, 0.54015, 0.98930],\n               [0.26878, 0.54995, 0.99303],\n               [0.26592, 0.55979, 0.99583],\n               [0.26252, 0.56967, 0.99773],\n               [0.25862, 0.57958, 0.99876],\n               [0.25425, 0.58950, 0.99896],\n               [0.24946, 0.59943, 0.99835],\n               [0.24427, 0.60937, 0.99697],\n               [0.23874, 0.61931, 0.99485],\n               [0.23288, 0.62923, 0.99202],\n               [0.22676, 0.63913, 0.98851],\n               [0.22039, 0.64901, 0.98436],\n               [0.21382, 0.65886, 0.97959],\n               [0.20708, 0.66866, 0.97423],\n               [0.20021, 0.67842, 0.96833],\n               [0.19326, 0.68812, 0.96190],\n               [0.18625, 0.69775, 0.95498],\n               [0.17923, 0.70732, 0.94761],\n               [0.17223, 0.71680, 0.93981],\n               [0.16529, 0.72620, 0.93161],\n               [0.15844, 0.73551, 0.92305],\n               [0.15173, 0.74472, 0.91416],\n               [0.14519, 0.75381, 0.90496],\n               [0.13886, 0.76279, 0.89550],\n               [0.13278, 0.77165, 0.88580],\n               [0.12698, 0.78037, 0.87590],\n               [0.12151, 0.78896, 0.86581],\n               [0.11639, 0.79740, 0.85559],\n               [0.11167, 0.80569, 0.84525],\n               [0.10738, 0.81381, 0.83484],\n               [0.10357, 0.82177, 0.82437],\n               [0.10026, 0.82955, 0.81389],\n               [0.09750, 0.83714, 0.80342],\n               [0.09532, 0.84455, 0.79299],\n               [0.09377, 0.85175, 0.78264],\n               [0.09287, 0.85875, 0.77240],\n               [0.09267, 0.86554, 0.76230],\n               [0.09320, 0.87211, 0.75237],\n               [0.09451, 0.87844, 0.74265],\n               [0.09662, 0.88454, 0.73316],\n               [0.09958, 0.89040, 0.72393],\n               [0.10342, 0.89600, 0.71500],\n               [0.10815, 0.90142, 0.70599],\n               [0.11374, 0.90673, 0.69651],\n               [0.12014, 0.91193, 0.68660],\n               [0.12733, 0.91701, 0.67627],\n               [0.13526, 0.92197, 0.66556],\n               [0.14391, 0.92680, 0.65448],\n               [0.15323, 0.93151, 0.64308],\n               [0.16319, 0.93609, 0.63137],\n               [0.17377, 0.94053, 0.61938],\n               [0.18491, 0.94484, 0.60713],\n               [0.19659, 0.94901, 0.59466],\n               [0.20877, 0.95304, 0.58199],\n               [0.22142, 0.95692, 0.56914],\n               [0.23449, 0.96065, 0.55614],\n               [0.24797, 0.96423, 0.54303],\n               [0.26180, 0.96765, 0.52981],\n               [0.27597, 0.97092, 0.51653],\n               [0.29042, 0.97403, 0.50321],\n               [0.30513, 0.97697, 0.48987],\n               [0.32006, 0.97974, 0.47654],\n               [0.33517, 0.98234, 0.46325],\n               [0.35043, 0.98477, 0.45002],\n               [0.36581, 0.98702, 0.43688],\n               [0.38127, 0.98909, 0.42386],\n               [0.39678, 0.99098, 0.41098],\n               [0.41229, 0.99268, 0.39826],\n               [0.42778, 0.99419, 0.38575],\n               [0.44321, 0.99551, 0.37345],\n               [0.45854, 0.99663, 0.36140],\n               [0.47375, 0.99755, 0.34963],\n               [0.48879, 0.99828, 0.33816],\n               [0.50362, 0.99879, 0.32701],\n               [0.51822, 0.99910, 0.31622],\n               [0.53255, 0.99919, 0.30581],\n               [0.54658, 0.99907, 0.29581],\n               [0.56026, 0.99873, 0.28623],\n               [0.57357, 0.99817, 0.27712],\n               [0.58646, 0.99739, 0.26849],\n               [0.59891, 0.99638, 0.26038],\n               [0.61088, 0.99514, 0.25280],\n               [0.62233, 0.99366, 0.24579],\n               [0.63323, 0.99195, 0.23937],\n               [0.64362, 0.98999, 0.23356],\n               [0.65394, 0.98775, 0.22835],\n               [0.66428, 0.98524, 0.22370],\n               [0.67462, 0.98246, 0.21960],\n               [0.68494, 0.97941, 0.21602],\n               [0.69525, 0.97610, 0.21294],\n               [0.70553, 0.97255, 0.21032],\n               [0.71577, 0.96875, 0.20815],\n               [0.72596, 0.96470, 0.20640],\n               [0.73610, 0.96043, 0.20504],\n               [0.74617, 0.95593, 0.20406],\n               [0.75617, 0.95121, 0.20343],\n               [0.76608, 0.94627, 0.20311],\n               [0.77591, 0.94113, 0.20310],\n               [0.78563, 0.93579, 0.20336],\n               [0.79524, 0.93025, 0.20386],\n               [0.80473, 0.92452, 0.20459],\n               [0.81410, 0.91861, 0.20552],\n               [0.82333, 0.91253, 0.20663],\n               [0.83241, 0.90627, 0.20788],\n               [0.84133, 0.89986, 0.20926],\n               [0.85010, 0.89328, 0.21074],\n               [0.85868, 0.88655, 0.21230],\n               [0.86709, 0.87968, 0.21391],\n               [0.87530, 0.87267, 0.21555],\n               [0.88331, 0.86553, 0.21719],\n               [0.89112, 0.85826, 0.21880],\n               [0.89870, 0.85087, 0.22038],\n               [0.90605, 0.84337, 0.22188],\n               [0.91317, 0.83576, 0.22328],\n               [0.92004, 0.82806, 0.22456],\n               [0.92666, 0.82025, 0.22570],\n               [0.93301, 0.81236, 0.22667],\n               [0.93909, 0.80439, 0.22744],\n               [0.94489, 0.79634, 0.22800],\n               [0.95039, 0.78823, 0.22831],\n               [0.95560, 0.78005, 0.22836],\n               [0.96049, 0.77181, 0.22811],\n               [0.96507, 0.76352, 0.22754],\n               [0.96931, 0.75519, 0.22663],\n               [0.97323, 0.74682, 0.22536],\n               [0.97679, 0.73842, 0.22369],\n               [0.98000, 0.73000, 0.22161],\n               [0.98289, 0.72140, 0.21918],\n               [0.98549, 0.71250, 0.21650],\n               [0.98781, 0.70330, 0.21358],\n               [0.98986, 0.69382, 0.21043],\n               [0.99163, 0.68408, 0.20706],\n               [0.99314, 0.67408, 0.20348],\n               [0.99438, 0.66386, 0.19971],\n               [0.99535, 0.65341, 0.19577],\n               [0.99607, 0.64277, 0.19165],\n               [0.99654, 0.63193, 0.18738],\n               [0.99675, 0.62093, 0.18297],\n               [0.99672, 0.60977, 0.17842],\n               [0.99644, 0.59846, 0.17376],\n               [0.99593, 0.58703, 0.16899],\n               [0.99517, 0.57549, 0.16412],\n               [0.99419, 0.56386, 0.15918],\n               [0.99297, 0.55214, 0.15417],\n               [0.99153, 0.54036, 0.14910],\n               [0.98987, 0.52854, 0.14398],\n               [0.98799, 0.51667, 0.13883],\n               [0.98590, 0.50479, 0.13367],\n               [0.98360, 0.49291, 0.12849],\n               [0.98108, 0.48104, 0.12332],\n               [0.97837, 0.46920, 0.11817],\n               [0.97545, 0.45740, 0.11305],\n               [0.97234, 0.44565, 0.10797],\n               [0.96904, 0.43399, 0.10294],\n               [0.96555, 0.42241, 0.09798],\n               [0.96187, 0.41093, 0.09310],\n               [0.95801, 0.39958, 0.08831],\n               [0.95398, 0.38836, 0.08362],\n               [0.94977, 0.37729, 0.07905],\n               [0.94538, 0.36638, 0.07461],\n               [0.94084, 0.35566, 0.07031],\n               [0.93612, 0.34513, 0.06616],\n               [0.93125, 0.33482, 0.06218],\n               [0.92623, 0.32473, 0.05837],\n               [0.92105, 0.31489, 0.05475],\n               [0.91572, 0.30530, 0.05134],\n               [0.91024, 0.29599, 0.04814],\n               [0.90463, 0.28696, 0.04516],\n               [0.89888, 0.27824, 0.04243],\n               [0.89298, 0.26981, 0.03993],\n               [0.88691, 0.26152, 0.03753],\n               [0.88066, 0.25334, 0.03521],\n               [0.87422, 0.24526, 0.03297],\n               [0.86760, 0.23730, 0.03082],\n               [0.86079, 0.22945, 0.02875],\n               [0.85380, 0.22170, 0.02677],\n               [0.84662, 0.21407, 0.02487],\n               [0.83926, 0.20654, 0.02305],\n               [0.83172, 0.19912, 0.02131],\n               [0.82399, 0.19182, 0.01966],\n               [0.81608, 0.18462, 0.01809],\n               [0.80799, 0.17753, 0.01660],\n               [0.79971, 0.17055, 0.01520],\n               [0.79125, 0.16368, 0.01387],\n               [0.78260, 0.15693, 0.01264],\n               [0.77377, 0.15028, 0.01148],\n               [0.76476, 0.14374, 0.01041],\n               [0.75556, 0.13731, 0.00942],\n               [0.74617, 0.13098, 0.00851],\n               [0.73661, 0.12477, 0.00769],\n               [0.72686, 0.11867, 0.00695],\n               [0.71692, 0.11268, 0.00629],\n               [0.70680, 0.10680, 0.00571],\n               [0.69650, 0.10102, 0.00522],\n               [0.68602, 0.09536, 0.00481],\n               [0.67535, 0.08980, 0.00449],\n               [0.66449, 0.08436, 0.00424],\n               [0.65345, 0.07902, 0.00408],\n               [0.64223, 0.07380, 0.00401],\n               [0.63082, 0.06868, 0.00401],\n               [0.61923, 0.06367, 0.00410],\n               [0.60746, 0.05878, 0.00427],\n               [0.59550, 0.05399, 0.00453],\n               [0.58336, 0.04931, 0.00486],\n               [0.57103, 0.04474, 0.00529],\n               [0.55852, 0.04028, 0.00579],\n               [0.54583, 0.03593, 0.00638],\n               [0.53295, 0.03169, 0.00705],\n               [0.51989, 0.02756, 0.00780],\n               [0.50664, 0.02354, 0.00863],\n               [0.49321, 0.01963, 0.00955],\n               [0.47960, 0.01583, 0.01055]],\n              [[0.18995, 0.07176, 0.23217],\n               [0.19483, 0.08339, 0.26149],\n               [0.19956, 0.09498, 0.29024],\n               [0.20415, 0.10652, 0.31844],\n               [0.20860, 0.11802, 0.34607],\n               [0.21291, 0.12947, 0.37314],\n               [0.21708, 0.14087, 0.39964],\n               [0.22111, 0.15223, 0.42558],\n               [0.22500, 0.16354, 0.45096],\n               [0.22875, 0.17481, 0.47578],\n               [0.23236, 0.18603, 0.50004],\n               [0.23582, 0.19720, 0.52373],\n               [0.23915, 0.20833, 0.54686],\n               [0.24234, 0.21941, 0.56942],\n               [0.24539, 0.23044, 0.59142],\n               [0.24830, 0.24143, 0.61286],\n               [0.25107, 0.25237, 0.63374],\n               [0.25369, 0.26327, 0.65406],\n               [0.25618, 0.27412, 0.67381],\n               [0.25853, 0.28492, 0.69300],\n               [0.26074, 0.29568, 0.71162],\n               [0.26280, 0.30639, 0.72968],\n               [0.26473, 0.31706, 0.74718],\n               [0.26652, 0.32768, 0.76412],\n               [0.26816, 0.33825, 0.78050],\n               [0.26967, 0.34878, 0.79631],\n               [0.27103, 0.35926, 0.81156],\n               [0.27226, 0.36970, 0.82624],\n               [0.27334, 0.38008, 0.84037],\n               [0.27429, 0.39043, 0.85393],\n               [0.27509, 0.40072, 0.86692],\n               [0.27576, 0.41097, 0.87936],\n               [0.27628, 0.42118, 0.89123],\n               [0.27667, 0.43134, 0.90254],\n               [0.27691, 0.44145, 0.91328],\n               [0.27701, 0.45152, 0.92347],\n               [0.27698, 0.46153, 0.93309],\n               [0.27680, 0.47151, 0.94214],\n               [0.27648, 0.48144, 0.95064],\n               [0.27603, 0.49132, 0.95857],\n               [0.27543, 0.50115, 0.96594],\n               [0.27469, 0.51094, 0.97275],\n               [0.27381, 0.52069, 0.97899],\n               [0.27273, 0.53040, 0.98461],\n               [0.27106, 0.54015, 0.98930],\n               [0.26878, 0.54995, 0.99303],\n               [0.26592, 0.55979, 0.99583],\n               [0.26252, 0.56967, 0.99773],\n               [0.25862, 0.57958, 0.99876],\n               [0.25425, 0.58950, 0.99896],\n               [0.24946, 0.59943, 0.99835],\n               [0.24427, 0.60937, 0.99697],\n               [0.23874, 0.61931, 0.99485],\n               [0.23288, 0.62923, 0.99202],\n               [0.22676, 0.63913, 0.98851],\n               [0.22039, 0.64901, 0.98436],\n               [0.21382, 0.65886, 0.97959],\n               [0.20708, 0.66866, 0.97423],\n               [0.20021, 0.67842, 0.96833],\n               [0.19326, 0.68812, 0.96190],\n               [0.18625, 0.69775, 0.95498],\n               [0.17923, 0.70732, 0.94761],\n               [0.17223, 0.71680, 0.93981],\n               [0.16529, 0.72620, 0.93161],\n               [0.15844, 0.73551, 0.92305],\n               [0.15173, 0.74472, 0.91416],\n               [0.14519, 0.75381, 0.90496],\n               [0.13886, 0.76279, 0.89550],\n               [0.13278, 0.77165, 0.88580],\n               [0.12698, 0.78037, 0.87590],\n               [0.12151, 0.78896, 0.86581],\n               [0.11639, 0.79740, 0.85559],\n               [0.11167, 0.80569, 0.84525],\n               [0.10738, 0.81381, 0.83484],\n               [0.10357, 0.82177, 0.82437],\n               [0.10026, 0.82955, 0.81389],\n               [0.09750, 0.83714, 0.80342],\n               [0.09532, 0.84455, 0.79299],\n               [0.09377, 0.85175, 0.78264],\n               [0.09287, 0.85875, 0.77240],\n               [0.09267, 0.86554, 0.76230],\n               [0.09320, 0.87211, 0.75237],\n               [0.09451, 0.87844, 0.74265],\n               [0.09662, 0.88454, 0.73316],\n               [0.09958, 0.89040, 0.72393],\n               [0.10342, 0.89600, 0.71500],\n               [0.10815, 0.90142, 0.70599],\n               [0.11374, 0.90673, 0.69651],\n               [0.12014, 0.91193, 0.68660],\n               [0.12733, 0.91701, 0.67627],\n               [0.13526, 0.92197, 0.66556],\n               [0.14391, 0.92680, 0.65448],\n               [0.15323, 0.93151, 0.64308],\n               [0.16319, 0.93609, 0.63137],\n               [0.17377, 0.94053, 0.61938],\n               [0.18491, 0.94484, 0.60713],\n               [0.19659, 0.94901, 0.59466],\n               [0.20877, 0.95304, 0.58199],\n               [0.22142, 0.95692, 0.56914],\n               [0.23449, 0.96065, 0.55614],\n               [0.24797, 0.96423, 0.54303],\n               [0.26180, 0.96765, 0.52981],\n               [0.27597, 0.97092, 0.51653],\n               [0.29042, 0.97403, 0.50321],\n               [0.30513, 0.97697, 0.48987],\n               [0.32006, 0.97974, 0.47654],\n               [0.33517, 0.98234, 0.46325],\n               [0.35043, 0.98477, 0.45002],\n               [0.36581, 0.98702, 0.43688],\n               [0.38127, 0.98909, 0.42386],\n               [0.39678, 0.99098, 0.41098],\n               [0.41229, 0.99268, 0.39826],\n               [0.42778, 0.99419, 0.38575],\n               [0.44321, 0.99551, 0.37345],\n               [0.45854, 0.99663, 0.36140],\n               [0.47375, 0.99755, 0.34963],\n               [0.48879, 0.99828, 0.33816],\n               [0.50362, 0.99879, 0.32701],\n               [0.51822, 0.99910, 0.31622],\n               [0.53255, 0.99919, 0.30581],\n               [0.54658, 0.99907, 0.29581],\n               [0.56026, 0.99873, 0.28623],\n               [0.57357, 0.99817, 0.27712],\n               [0.58646, 0.99739, 0.26849],\n               [0.59891, 0.99638, 0.26038],\n               [0.61088, 0.99514, 0.25280],\n               [0.62233, 0.99366, 0.24579],\n               [0.63323, 0.99195, 0.23937],\n               [0.64362, 0.98999, 0.23356],\n               [0.65394, 0.98775, 0.22835],\n               [0.66428, 0.98524, 0.22370],\n               [0.67462, 0.98246, 0.21960],\n               [0.68494, 0.97941, 0.21602],\n               [0.69525, 0.97610, 0.21294],\n               [0.70553, 0.97255, 0.21032],\n               [0.71577, 0.96875, 0.20815],\n               [0.72596, 0.96470, 0.20640],\n               [0.73610, 0.96043, 0.20504],\n               [0.74617, 0.95593, 0.20406],\n               [0.75617, 0.95121, 0.20343],\n               [0.76608, 0.94627, 0.20311],\n               [0.77591, 0.94113, 0.20310],\n               [0.78563, 0.93579, 0.20336],\n               [0.79524, 0.93025, 0.20386],\n               [0.80473, 0.92452, 0.20459],\n               [0.81410, 0.91861, 0.20552],\n               [0.82333, 0.91253, 0.20663],\n               [0.83241, 0.90627, 0.20788],\n               [0.84133, 0.89986, 0.20926],\n               [0.85010, 0.89328, 0.21074],\n               [0.85868, 0.88655, 0.21230],\n               [0.86709, 0.87968, 0.21391],\n               [0.87530, 0.87267, 0.21555],\n               [0.88331, 0.86553, 0.21719],\n               [0.89112, 0.85826, 0.21880],\n               [0.89870, 0.85087, 0.22038],\n               [0.90605, 0.84337, 0.22188],\n               [0.91317, 0.83576, 0.22328],\n               [0.92004, 0.82806, 0.22456],\n               [0.92666, 0.82025, 0.22570],\n               [0.93301, 0.81236, 0.22667],\n               [0.93909, 0.80439, 0.22744],\n               [0.94489, 0.79634, 0.22800],\n               [0.95039, 0.78823, 0.22831],\n               [0.95560, 0.78005, 0.22836],\n               [0.96049, 0.77181, 0.22811],\n               [0.96507, 0.76352, 0.22754],\n               [0.96931, 0.75519, 0.22663],\n               [0.97323, 0.74682, 0.22536],\n               [0.97679, 0.73842, 0.22369],\n               [0.98000, 0.73000, 0.22161],\n               [0.98289, 0.72140, 0.21918],\n               [0.98549, 0.71250, 0.21650],\n               [0.98781, 0.70330, 0.21358],\n               [0.98986, 0.69382, 0.21043],\n               [0.99163, 0.68408, 0.20706],\n               [0.99314, 0.67408, 0.20348],\n               [0.99438, 0.66386, 0.19971],\n               [0.99535, 0.65341, 0.19577],\n               [0.99607, 0.64277, 0.19165],\n               [0.99654, 0.63193, 0.18738],\n               [0.99675, 0.62093, 0.18297],\n               [0.99672, 0.60977, 0.17842],\n               [0.99644, 0.59846, 0.17376],\n               [0.99593, 0.58703, 0.16899],\n               [0.99517, 0.57549, 0.16412],\n               [0.99419, 0.56386, 0.15918],\n               [0.99297, 0.55214, 0.15417],\n               [0.99153, 0.54036, 0.14910],\n               [0.98987, 0.52854, 0.14398],\n               [0.98799, 0.51667, 0.13883],\n               [0.98590, 0.50479, 0.13367],\n               [0.98360, 0.49291, 0.12849],\n               [0.98108, 0.48104, 0.12332],\n               [0.97837, 0.46920, 0.11817],\n               [0.97545, 0.45740, 0.11305],\n               [0.97234, 0.44565, 0.10797],\n               [0.96904, 0.43399, 0.10294],\n               [0.96555, 0.42241, 0.09798],\n               [0.96187, 0.41093, 0.09310],\n               [0.95801, 0.39958, 0.08831],\n               [0.95398, 0.38836, 0.08362],\n               [0.94977, 0.37729, 0.07905],\n               [0.94538, 0.36638, 0.07461],\n               [0.94084, 0.35566, 0.07031],\n               [0.93612, 0.34513, 0.06616],\n               [0.93125, 0.33482, 0.06218],\n               [0.92623, 0.32473, 0.05837],\n               [0.92105, 0.31489, 0.05475],\n               [0.91572, 0.30530, 0.05134],\n               [0.91024, 0.29599, 0.04814],\n               [0.90463, 0.28696, 0.04516],\n               [0.89888, 0.27824, 0.04243],\n               [0.89298, 0.26981, 0.03993],\n               [0.88691, 0.26152, 0.03753],\n               [0.88066, 0.25334, 0.03521],\n               [0.87422, 0.24526, 0.03297],\n               [0.86760, 0.23730, 0.03082],\n               [0.86079, 0.22945, 0.02875],\n               [0.85380, 0.22170, 0.02677],\n               [0.84662, 0.21407, 0.02487],\n               [0.83926, 0.20654, 0.02305],\n               [0.83172, 0.19912, 0.02131],\n               [0.82399, 0.19182, 0.01966],\n               [0.81608, 0.18462, 0.01809],\n               [0.80799, 0.17753, 0.01660],\n               [0.79971, 0.17055, 0.01520],\n               [0.79125, 0.16368, 0.01387],\n               [0.78260, 0.15693, 0.01264],\n               [0.77377, 0.15028, 0.01148],\n               [0.76476, 0.14374, 0.01041],\n               [0.75556, 0.13731, 0.00942],\n               [0.74617, 0.13098, 0.00851],\n               [0.73661, 0.12477, 0.00769],\n               [0.72686, 0.11867, 0.00695],\n               [0.71692, 0.11268, 0.00629],\n               [0.70680, 0.10680, 0.00571],\n               [0.69650, 0.10102, 0.00522],\n               [0.68602, 0.09536, 0.00481],\n               [0.67535, 0.08980, 0.00449],\n               [0.66449, 0.08436, 0.00424],\n               [0.65345, 0.07902, 0.00408],\n               [0.64223, 0.07380, 0.00401],\n               [0.63082, 0.06868, 0.00401],\n               [0.61923, 0.06367, 0.00410],\n               [0.60746, 0.05878, 0.00427],\n               [0.59550, 0.05399, 0.00453],\n               [0.58336, 0.04931, 0.00486],\n               [0.57103, 0.04474, 0.00529],\n               [0.55852, 0.04028, 0.00579],\n               [0.54583, 0.03593, 0.00638],\n               [0.53295, 0.03169, 0.00705],\n               [0.51989, 0.02756, 0.00780],\n               [0.50664, 0.02354, 0.00863],\n               [0.49321, 0.01963, 0.00955],\n               [0.47960, 0.01583, 0.01055]],\n              [[0.18995, 0.07176, 0.23217],\n               [0.19483, 0.08339, 0.26149],\n               [0.19956, 0.09498, 0.29024],\n               [0.20415, 0.10652, 0.31844],\n               [0.20860, 0.11802, 0.34607],\n               [0.21291, 0.12947, 0.37314],\n               [0.21708, 0.14087, 0.39964],\n               [0.22111, 0.15223, 0.42558],\n               [0.22500, 0.16354, 0.45096],\n               [0.22875, 0.17481, 0.47578],\n               [0.23236, 0.18603, 0.50004],\n               [0.23582, 0.19720, 0.52373],\n               [0.23915, 0.20833, 0.54686],\n               [0.24234, 0.21941, 0.56942],\n               [0.24539, 0.23044, 0.59142],\n               [0.24830, 0.24143, 0.61286],\n               [0.25107, 0.25237, 0.63374],\n               [0.25369, 0.26327, 0.65406],\n               [0.25618, 0.27412, 0.67381],\n               [0.25853, 0.28492, 0.69300],\n               [0.26074, 0.29568, 0.71162],\n               [0.26280, 0.30639, 0.72968],\n               [0.26473, 0.31706, 0.74718],\n               [0.26652, 0.32768, 0.76412],\n               [0.26816, 0.33825, 0.78050],\n               [0.26967, 0.34878, 0.79631],\n               [0.27103, 0.35926, 0.81156],\n               [0.27226, 0.36970, 0.82624],\n               [0.27334, 0.38008, 0.84037],\n               [0.27429, 0.39043, 0.85393],\n               [0.27509, 0.40072, 0.86692],\n               [0.27576, 0.41097, 0.87936],\n               [0.27628, 0.42118, 0.89123],\n               [0.27667, 0.43134, 0.90254],\n               [0.27691, 0.44145, 0.91328],\n               [0.27701, 0.45152, 0.92347],\n               [0.27698, 0.46153, 0.93309],\n               [0.27680, 0.47151, 0.94214],\n               [0.27648, 0.48144, 0.95064],\n               [0.27603, 0.49132, 0.95857],\n               [0.27543, 0.50115, 0.96594],\n               [0.27469, 0.51094, 0.97275],\n               [0.27381, 0.52069, 0.97899],\n               [0.27273, 0.53040, 0.98461],\n               [0.27106, 0.54015, 0.98930],\n               [0.26878, 0.54995, 0.99303],\n               [0.26592, 0.55979, 0.99583],\n               [0.26252, 0.56967, 0.99773],\n               [0.25862, 0.57958, 0.99876],\n               [0.25425, 0.58950, 0.99896],\n               [0.24946, 0.59943, 0.99835],\n               [0.24427, 0.60937, 0.99697],\n               [0.23874, 0.61931, 0.99485],\n               [0.23288, 0.62923, 0.99202],\n               [0.22676, 0.63913, 0.98851],\n               [0.22039, 0.64901, 0.98436],\n               [0.21382, 0.65886, 0.97959],\n               [0.20708, 0.66866, 0.97423],\n               [0.20021, 0.67842, 0.96833],\n               [0.19326, 0.68812, 0.96190],\n               [0.18625, 0.69775, 0.95498],\n               [0.17923, 0.70732, 0.94761],\n               [0.17223, 0.71680, 0.93981],\n               [0.16529, 0.72620, 0.93161],\n               [0.15844, 0.73551, 0.92305],\n               [0.15173, 0.74472, 0.91416],\n               [0.14519, 0.75381, 0.90496],\n               [0.13886, 0.76279, 0.89550],\n               [0.13278, 0.77165, 0.88580],\n               [0.12698, 0.78037, 0.87590],\n               [0.12151, 0.78896, 0.86581],\n               [0.11639, 0.79740, 0.85559],\n               [0.11167, 0.80569, 0.84525],\n               [0.10738, 0.81381, 0.83484],\n               [0.10357, 0.82177, 0.82437],\n               [0.10026, 0.82955, 0.81389],\n               [0.09750, 0.83714, 0.80342],\n               [0.09532, 0.84455, 0.79299],\n               [0.09377, 0.85175, 0.78264],\n               [0.09287, 0.85875, 0.77240],\n               [0.09267, 0.86554, 0.76230],\n               [0.09320, 0.87211, 0.75237],\n               [0.09451, 0.87844, 0.74265],\n               [0.09662, 0.88454, 0.73316],\n               [0.09958, 0.89040, 0.72393],\n               [0.10342, 0.89600, 0.71500],\n               [0.10815, 0.90142, 0.70599],\n               [0.11374, 0.90673, 0.69651],\n               [0.12014, 0.91193, 0.68660],\n               [0.12733, 0.91701, 0.67627],\n               [0.13526, 0.92197, 0.66556],\n               [0.14391, 0.92680, 0.65448],\n               [0.15323, 0.93151, 0.64308],\n               [0.16319, 0.93609, 0.63137],\n               [0.17377, 0.94053, 0.61938],\n               [0.18491, 0.94484, 0.60713],\n               [0.19659, 0.94901, 0.59466],\n               [0.20877, 0.95304, 0.58199],\n               [0.22142, 0.95692, 0.56914],\n               [0.23449, 0.96065, 0.55614],\n               [0.24797, 0.96423, 0.54303],\n               [0.26180, 0.96765, 0.52981],\n               [0.27597, 0.97092, 0.51653],\n               [0.29042, 0.97403, 0.50321],\n               [0.30513, 0.97697, 0.48987],\n               [0.32006, 0.97974, 0.47654],\n               [0.33517, 0.98234, 0.46325],\n               [0.35043, 0.98477, 0.45002],\n               [0.36581, 0.98702, 0.43688],\n               [0.38127, 0.98909, 0.42386],\n               [0.39678, 0.99098, 0.41098],\n               [0.41229, 0.99268, 0.39826],\n               [0.42778, 0.99419, 0.38575],\n               [0.44321, 0.99551, 0.37345],\n               [0.45854, 0.99663, 0.36140],\n               [0.47375, 0.99755, 0.34963],\n               [0.48879, 0.99828, 0.33816],\n               [0.50362, 0.99879, 0.32701],\n               [0.51822, 0.99910, 0.31622],\n               [0.53255, 0.99919, 0.30581],\n               [0.54658, 0.99907, 0.29581],\n               [0.56026, 0.99873, 0.28623],\n               [0.57357, 0.99817, 0.27712],\n               [0.58646, 0.99739, 0.26849],\n               [0.59891, 0.99638, 0.26038],\n               [0.61088, 0.99514, 0.25280],\n               [0.62233, 0.99366, 0.24579],\n               [0.63323, 0.99195, 0.23937],\n               [0.64362, 0.98999, 0.23356],\n               [0.65394, 0.98775, 0.22835],\n               [0.66428, 0.98524, 0.22370],\n               [0.67462, 0.98246, 0.21960],\n               [0.68494, 0.97941, 0.21602],\n               [0.69525, 0.97610, 0.21294],\n               [0.70553, 0.97255, 0.21032],\n               [0.71577, 0.96875, 0.20815],\n               [0.72596, 0.96470, 0.20640],\n               [0.73610, 0.96043, 0.20504],\n               [0.74617, 0.95593, 0.20406],\n               [0.75617, 0.95121, 0.20343],\n               [0.76608, 0.94627, 0.20311],\n               [0.77591, 0.94113, 0.20310],\n               [0.78563, 0.93579, 0.20336],\n               [0.79524, 0.93025, 0.20386],\n               [0.80473, 0.92452, 0.20459],\n               [0.81410, 0.91861, 0.20552],\n               [0.82333, 0.91253, 0.20663],\n               [0.83241, 0.90627, 0.20788],\n               [0.84133, 0.89986, 0.20926],\n               [0.85010, 0.89328, 0.21074],\n               [0.85868, 0.88655, 0.21230],\n               [0.86709, 0.87968, 0.21391],\n               [0.87530, 0.87267, 0.21555],\n               [0.88331, 0.86553, 0.21719],\n               [0.89112, 0.85826, 0.21880],\n               [0.89870, 0.85087, 0.22038],\n               [0.90605, 0.84337, 0.22188],\n               [0.91317, 0.83576, 0.22328],\n               [0.92004, 0.82806, 0.22456],\n               [0.92666, 0.82025, 0.22570],\n               [0.93301, 0.81236, 0.22667],\n               [0.93909, 0.80439, 0.22744],\n               [0.94489, 0.79634, 0.22800],\n               [0.95039, 0.78823, 0.22831],\n               [0.95560, 0.78005, 0.22836],\n               [0.96049, 0.77181, 0.22811],\n               [0.96507, 0.76352, 0.22754],\n               [0.96931, 0.75519, 0.22663],\n               [0.97323, 0.74682, 0.22536],\n               [0.97679, 0.73842, 0.22369],\n               [0.98000, 0.73000, 0.22161],\n               [0.98289, 0.72140, 0.21918],\n               [0.98549, 0.71250, 0.21650],\n               [0.98781, 0.70330, 0.21358],\n               [0.98986, 0.69382, 0.21043],\n               [0.99163, 0.68408, 0.20706],\n               [0.99314, 0.67408, 0.20348],\n               [0.99438, 0.66386, 0.19971],\n               [0.99535, 0.65341, 0.19577],\n               [0.99607, 0.64277, 0.19165],\n               [0.99654, 0.63193, 0.18738],\n               [0.99675, 0.62093, 0.18297],\n               [0.99672, 0.60977, 0.17842],\n               [0.99644, 0.59846, 0.17376],\n               [0.99593, 0.58703, 0.16899],\n               [0.99517, 0.57549, 0.16412],\n               [0.99419, 0.56386, 0.15918],\n               [0.99297, 0.55214, 0.15417],\n               [0.99153, 0.54036, 0.14910],\n               [0.98987, 0.52854, 0.14398],\n               [0.98799, 0.51667, 0.13883],\n               [0.98590, 0.50479, 0.13367],\n               [0.98360, 0.49291, 0.12849],\n               [0.98108, 0.48104, 0.12332],\n               [0.97837, 0.46920, 0.11817],\n               [0.97545, 0.45740, 0.11305],\n               [0.97234, 0.44565, 0.10797],\n               [0.96904, 0.43399, 0.10294],\n               [0.96555, 0.42241, 0.09798],\n               [0.96187, 0.41093, 0.09310],\n               [0.95801, 0.39958, 0.08831],\n               [0.95398, 0.38836, 0.08362],\n               [0.94977, 0.37729, 0.07905],\n               [0.94538, 0.36638, 0.07461],\n               [0.94084, 0.35566, 0.07031],\n               [0.93612, 0.34513, 0.06616],\n               [0.93125, 0.33482, 0.06218],\n               [0.92623, 0.32473, 0.05837],\n               [0.92105, 0.31489, 0.05475],\n               [0.91572, 0.30530, 0.05134],\n               [0.91024, 0.29599, 0.04814],\n               [0.90463, 0.28696, 0.04516],\n               [0.89888, 0.27824, 0.04243],\n               [0.89298, 0.26981, 0.03993],\n               [0.88691, 0.26152, 0.03753],\n               [0.88066, 0.25334, 0.03521],\n               [0.87422, 0.24526, 0.03297],\n               [0.86760, 0.23730, 0.03082],\n               [0.86079, 0.22945, 0.02875],\n               [0.85380, 0.22170, 0.02677],\n               [0.84662, 0.21407, 0.02487],\n               [0.83926, 0.20654, 0.02305],\n               [0.83172, 0.19912, 0.02131],\n               [0.82399, 0.19182, 0.01966],\n               [0.81608, 0.18462, 0.01809],\n               [0.80799, 0.17753, 0.01660],\n               [0.79971, 0.17055, 0.01520],\n               [0.79125, 0.16368, 0.01387],\n               [0.78260, 0.15693, 0.01264],\n               [0.77377, 0.15028, 0.01148],\n               [0.76476, 0.14374, 0.01041],\n               [0.75556, 0.13731, 0.00942],\n               [0.74617, 0.13098, 0.00851],\n               [0.73661, 0.12477, 0.00769],\n               [0.72686, 0.11867, 0.00695],\n               [0.71692, 0.11268, 0.00629],\n               [0.70680, 0.10680, 0.00571],\n               [0.69650, 0.10102, 0.00522],\n               [0.68602, 0.09536, 0.00481],\n               [0.67535, 0.08980, 0.00449],\n               [0.66449, 0.08436, 0.00424],\n               [0.65345, 0.07902, 0.00408],\n               [0.64223, 0.07380, 0.00401],\n               [0.63082, 0.06868, 0.00401],\n               [0.61923, 0.06367, 0.00410],\n               [0.60746, 0.05878, 0.00427],\n               [0.59550, 0.05399, 0.00453],\n               [0.58336, 0.04931, 0.00486],\n               [0.57103, 0.04474, 0.00529],\n               [0.55852, 0.04028, 0.00579],\n               [0.54583, 0.03593, 0.00638],\n               [0.53295, 0.03169, 0.00705],\n               [0.51989, 0.02756, 0.00780],\n               [0.50664, 0.02354, 0.00863],\n               [0.49321, 0.01963, 0.00955],\n               [0.47960, 0.01583, 0.01055]]]","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:41:12.758580Z","iopub.execute_input":"2024-04-19T04:41:12.759066Z","iopub.status.idle":"2024-04-19T04:41:12.945459Z","shell.execute_reply.started":"2024-04-19T04:41:12.759034Z","shell.execute_reply":"2024-04-19T04:41:12.944128Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import tensorflow as tf\n\nflat_turbo_data = [item for sublist in turbo_data for item in sublist]\nprint(len(flat_turbo_data))\ntf_turbo_data = tf.constant(flat_turbo_data, dtype=tf.float32)\nprint(tf_turbo_data.shape)\n\n","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:41:47.286495Z","iopub.execute_input":"2024-04-19T04:41:47.286944Z","iopub.status.idle":"2024-04-19T04:42:02.898276Z","shell.execute_reply.started":"2024-04-19T04:41:47.286912Z","shell.execute_reply":"2024-04-19T04:42:02.897286Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\nreshaped_tensor = tf.expand_dims(audio_speech, axis=0)\nreshaped_tensor = tf.expand_dims(reshaped_tensor, axis=-1)\nprint(audio_speech.shape)\nprint(reshaped_tensor.shape)\n\nx = tf.squeeze(reshaped_tensor, axis=-1)\nstft_result = tf.signal.stft(x, frame_length=256, frame_step=16)\nprint(stft_result.shape)\n    # Extract magnitude and phase\nmagnitude = tf.abs(stft_result)\n\n    # Convert the magnitude to decibels for better visualization\ndwt_magn = tf.math.log(magnitude + 1e-6)\ndwt_magn = tf.transpose(dwt_magn,perm=[1,2,0])\n    # magnitude_db = tf.expand_dims(magnitude_db,axis=-1)\nprint(dwt_magn.shape)\n    # Resize the magnitude_db tensor to shape [256, 256, batch_size]\ndwt_magn_resized = tf.image.resize(dwt_magn, [1024, 256])\nprint(dwt_magn_resized.shape)\ndwt_magn_resized = tf.transpose(dwt_magn_resized,perm=[2,1,0])\ndwt_magn_resized = tf.expand_dims(dwt_magn_resized,axis=-1)\nprint(dwt_magn_resized.shape)\n#dwt_magn_resized = tf.tile( dwt_magn_resized, [1,1, 1, 3])\n    \n    \ndwt_magn_resized = (dwt_magn_resized - tf.reduce_min(dwt_magn_resized)) / (tf.reduce_max(dwt_magn_resized) - tf.reduce_min(dwt_magn_resized))\nprint(dwt_magn_resized.dtype)\ndwt_squeezed = tf.squeeze(dwt_magn_resized, axis=-1)\nprint(dwt_squeezed.shape)\ndwt_indices = tf.cast(tf.math.round(dwt_squeezed * 255), dtype=tf.int32)\ndwt_image = tf.gather(tf_turbo_data, dwt_indices)\nprint(dwt_image.shape)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:42:43.659034Z","iopub.execute_input":"2024-04-19T04:42:43.659715Z","iopub.status.idle":"2024-04-19T04:42:43.910895Z","shell.execute_reply.started":"2024-04-19T04:42:43.659682Z","shell.execute_reply":"2024-04-19T04:42:43.909634Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\nplt.imshow(dwt_image[0], aspect='auto')\n\n","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:43:04.648993Z","iopub.execute_input":"2024-04-19T04:43:04.649697Z","iopub.status.idle":"2024-04-19T04:43:05.176697Z","shell.execute_reply.started":"2024-04-19T04:43:04.649657Z","shell.execute_reply":"2024-04-19T04:43:05.175416Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.imshow(magnitude[0], aspect='auto', cmap='turbo')","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:43:20.120807Z","iopub.execute_input":"2024-04-19T04:43:20.121262Z","iopub.status.idle":"2024-04-19T04:43:21.928923Z","shell.execute_reply.started":"2024-04-19T04:43:20.121230Z","shell.execute_reply":"2024-04-19T04:43:21.927755Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.imshow(dwt_magn_resized[0], aspect='auto', cmap='turbo')","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:43:52.402564Z","iopub.execute_input":"2024-04-19T04:43:52.402982Z","iopub.status.idle":"2024-04-19T04:43:52.861390Z","shell.execute_reply.started":"2024-04-19T04:43:52.402953Z","shell.execute_reply":"2024-04-19T04:43:52.860120Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Scalogram","metadata":{}},{"cell_type":"code","source":"import pywt\nscales = range(1, 64)\ncoefficients, frequencies = pywt.cwt(audio_speech, scales, wavelet = 'morl', method='conv')\nplt.imshow(np.abs(coefficients), aspect='auto', cmap='jet')\nprint(frequencies)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:44:55.258933Z","iopub.execute_input":"2024-04-19T04:44:55.259390Z","iopub.status.idle":"2024-04-19T04:45:02.486351Z","shell.execute_reply.started":"2024-04-19T04:44:55.259355Z","shell.execute_reply":"2024-04-19T04:45:02.485091Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scales = range(1, 64)\ncoefficients, frequencies = pywt.cwt(audio_speech, scales, wavelet = 'cmor1.5-1.0', method='fft')\nplt.figure(figsize=(20, 8))\nplt.imshow(np.abs(coefficients), aspect='auto', cmap='jet')\nprint(frequencies)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:45:31.284899Z","iopub.execute_input":"2024-04-19T04:45:31.285565Z","iopub.status.idle":"2024-04-19T04:45:52.489373Z","shell.execute_reply.started":"2024-04-19T04:45:31.285517Z","shell.execute_reply":"2024-04-19T04:45:52.488334Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scales = range(1, 128)\ncoefficients, frequencies = pywt.cwt(audio_speech, scales, wavelet = 'fbsp5-1.5-50', method='conv')\nplt.figure(figsize=(20, 8))\nplt.imshow(np.abs(coefficients), aspect='auto', cmap='jet')\nprint(frequencies)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T04:51:05.624093Z","iopub.execute_input":"2024-04-19T04:51:05.624492Z","iopub.status.idle":"2024-04-19T04:52:17.504159Z","shell.execute_reply.started":"2024-04-19T04:51:05.624464Z","shell.execute_reply":"2024-04-19T04:52:17.502744Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Using Tensorflow","metadata":{}},{"cell_type":"code","source":"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport tensorflow as tf\n\n\nclass ContinuousWaveletTransform(object):\n    \"\"\"CWT layer implementation in Tensorflow for GPU acceleration.\"\"\"\n    def __init__(self, n_scales, border_crop=0, stride=1, name=\"cwt\"):\n        \n        self.n_scales = n_scales\n        self.border_crop = border_crop\n        self.stride = stride\n        self.name = name\n        with tf.compat.v1.variable_scope(self.name):\n            self.real_part, self.imaginary_part = self._build_wavelet_bank()\n\n    def _build_wavelet_bank(self):\n        \"\"\"Needs implementation to compute the real and imaginary parts\n        of the wavelet bank. Each part is expected to have shape\n        [1, kernel_size, 1, n_scales].\"\"\"\n        real_part = None\n        imaginary_part = None\n        return real_part, imaginary_part\n\n    def __call__(self, inputs):\n        \n        # Generate the scalogram\n        border_crop = int(self.border_crop / self.stride)\n        start = border_crop\n        end = (-border_crop) if (border_crop > 0) else None\n        with tf.compat.v1.variable_scope(self.name):\n            # Input has expected shape of [batch_size, time_len, n_channels]\n            # We first unstack the input channels\n            inputs_unstacked = tf.unstack(inputs, axis=2)\n            multi_channel_cwt = []\n            for j, single_channel in enumerate(inputs_unstacked):\n                # Reshape input [batch, time_len] -> [batch, 1, time_len, 1]\n                inputs_expand = tf.expand_dims(single_channel, axis=1)\n                inputs_expand = tf.expand_dims(inputs_expand, axis=3)\n                with tf.name_scope('%s_%d' % (self.name, j)):\n                    bank_real = self.real_part\n                    bank_imag = -self.imaginary_part  # Conjugation\n                    out_real = tf.nn.conv2d(\n                        input=inputs_expand, filters=bank_real,\n                        strides=[1, 1, self.stride, 1], padding=\"SAME\")\n                    out_imag = tf.nn.conv2d(\n                        input=inputs_expand, filters=bank_imag,\n                        strides=[1, 1, self.stride, 1], padding=\"SAME\")\n                    out_real_crop = out_real[:, :, start:end, :]\n                    out_imag_crop = out_imag[:, :, start:end, :]\n                    out_concat = tf.concat(\n                        [out_real_crop, out_imag_crop], axis=1)\n                    # [batch, 2, time, n_scales]->[batch, time, n_scales, 2]\n                    single_scalogram = tf.transpose(\n                        out_concat, perm=[0, 2, 3, 1])\n                    multi_channel_cwt.append(single_scalogram)\n            # Get all in shape [batch, time_len, n_scales, 2*n_channels]\n            scalograms = tf.concat(multi_channel_cwt, -1)\n        return scalograms\n\n\nclass ComplexMorletCWT(ContinuousWaveletTransform):\n    \"\"\"CWT with the complex Morlet wavelet filter bank.\"\"\"\n    def __init__(\n            self,\n            wavelet_width,\n            fs,\n            lower_freq,\n            upper_freq,\n            n_scales,\n            size_factor=1.0,\n            trainable=False,\n            border_crop=0,\n            stride=1,\n            name=\"cwt\"):\n        \n\n        # Checking\n        if lower_freq > upper_freq:\n            raise ValueError(\"lower_freq should be lower than upper_freq\")\n        if lower_freq < 0:\n            raise ValueError(\"Expected positive lower_freq.\")\n\n        self.initial_wavelet_width = wavelet_width\n        self.fs = fs\n        self.lower_freq = lower_freq\n        self.upper_freq = upper_freq\n        self.size_factor = size_factor\n        self.trainable = trainable\n        # Generate initial and last scale\n        s_0 = 1 / self.upper_freq\n        s_n = 1 / self.lower_freq\n        # Generate the array of scales\n        base = np.power(s_n / s_0, 1 / (n_scales - 1))\n        self.scales = s_0 * np.power(base, np.arange(n_scales))\n        # Generate the frequency range\n        self.frequencies = 1 / self.scales\n        # Trainable wavelet width value\n        self.wavelet_width = tf.Variable(\n            initial_value=self.initial_wavelet_width,\n            trainable=self.trainable,\n            name='wavelet_width',\n            dtype=tf.float32)\n        super().__init__(n_scales, border_crop, stride, name)\n\n    def _build_wavelet_bank(self):\n        with tf.compat.v1.variable_scope(\"cmorlet_bank\"):\n            # Generate the wavelets\n            # We will make a bigger wavelet in case the width grows\n            # For the size of the wavelet we use the initial width value.\n            # |t| < truncation_size => |k| < truncation_size * fs\n            truncation_size = self.scales.max() * np.sqrt(4.5 * self.initial_wavelet_width) * self.fs\n            one_side = int(self.size_factor * truncation_size)\n            kernel_size = 2 * one_side + 1\n            k_array = np.arange(kernel_size, dtype=np.float32) - one_side\n            t_array = k_array / self.fs  # Time units\n            # Wavelet bank shape: 1, kernel_size, 1, n_scales\n            wavelet_bank_real = []\n            wavelet_bank_imag = []\n            for scale in self.scales:\n                norm_constant = tf.sqrt(np.pi * self.wavelet_width) * scale * self.fs / 2.0\n                scaled_t = t_array / scale\n                exp_term = tf.exp(-(scaled_t ** 2) / self.wavelet_width)\n                kernel_base = exp_term / norm_constant\n                kernel_real = kernel_base * np.cos(2 * np.pi * scaled_t)\n                kernel_imag = kernel_base * np.sin(2 * np.pi * scaled_t)\n                wavelet_bank_real.append(kernel_real)\n                wavelet_bank_imag.append(kernel_imag)\n            # Stack wavelets (shape = kernel_size, n_scales)\n            wavelet_bank_real = tf.stack(wavelet_bank_real, axis=-1)\n            wavelet_bank_imag = tf.stack(wavelet_bank_imag, axis=-1)\n            # Give it proper shape for convolutions\n            # -> shape: 1, kernel_size, n_scales\n            wavelet_bank_real = tf.expand_dims(wavelet_bank_real, axis=0)\n            wavelet_bank_imag = tf.expand_dims(wavelet_bank_imag, axis=0)\n            # -> shape: 1, kernel_size, 1, n_scales\n            wavelet_bank_real = tf.expand_dims(wavelet_bank_real, axis=2)\n            wavelet_bank_imag = tf.expand_dims(wavelet_bank_imag, axis=2)\n        return wavelet_bank_real, wavelet_bank_imag","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:08:28.588500Z","iopub.execute_input":"2024-04-19T05:08:28.588996Z","iopub.status.idle":"2024-04-19T05:08:28.621944Z","shell.execute_reply.started":"2024-04-19T05:08:28.588967Z","shell.execute_reply":"2024-04-19T05:08:28.620916Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"audio_speech.shape, rate","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:09:17.828390Z","iopub.execute_input":"2024-04-19T05:09:17.828807Z","iopub.status.idle":"2024-04-19T05:09:17.836300Z","shell.execute_reply.started":"2024-04-19T05:09:17.828779Z","shell.execute_reply":"2024-04-19T05:09:17.834905Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scale= np.arange(1, 603073)\ncwt = ComplexMorletCWT(wavelet_width=1, fs=rate, lower_freq=5, upper_freq=500, n_scales=500)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:09:34.329377Z","iopub.execute_input":"2024-04-19T05:09:34.330353Z","iopub.status.idle":"2024-04-19T05:09:35.159002Z","shell.execute_reply.started":"2024-04-19T05:09:34.330311Z","shell.execute_reply":"2024-04-19T05:09:35.158103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cwt.frequencies","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:09:52.620568Z","iopub.execute_input":"2024-04-19T05:09:52.621245Z","iopub.status.idle":"2024-04-19T05:09:52.639214Z","shell.execute_reply.started":"2024-04-19T05:09:52.621203Z","shell.execute_reply":"2024-04-19T05:09:52.638062Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"real_bank = cwt.real_part\nprint(real_bank)\nimag_bank = cwt.imaginary_part\nprint(imag_bank)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:10:11.245663Z","iopub.execute_input":"2024-04-19T05:10:11.246331Z","iopub.status.idle":"2024-04-19T05:10:11.252907Z","shell.execute_reply.started":"2024-04-19T05:10:11.246300Z","shell.execute_reply":"2024-04-19T05:10:11.252025Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\nscalogram= cwt( audio_speech.reshape((1, -1, 1)).astype(np.float32))\n\nprint(\"The result has shape\", scalogram.shape)\n\n","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:10:48.896104Z","iopub.execute_input":"2024-04-19T05:10:48.896793Z","iopub.status.idle":"2024-04-19T05:13:51.502976Z","shell.execute_reply.started":"2024-04-19T05:10:48.896758Z","shell.execute_reply":"2024-04-19T05:13:51.501588Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scalogram_real = scalogram[0, :, :, 0]\nscalogram_imag = scalogram[0, :, :, 1]\nscalogram_magn = tf.sqrt(scalogram_real ** 2 + scalogram_imag ** 2)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:13:51.505218Z","iopub.execute_input":"2024-04-19T05:13:51.505726Z","iopub.status.idle":"2024-04-19T05:13:59.973553Z","shell.execute_reply.started":"2024-04-19T05:13:51.505684Z","shell.execute_reply":"2024-04-19T05:13:59.972377Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scalogram","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:13:59.975043Z","iopub.execute_input":"2024-04-19T05:13:59.975415Z","iopub.status.idle":"2024-04-19T05:13:59.985016Z","shell.execute_reply.started":"2024-04-19T05:13:59.975381Z","shell.execute_reply":"2024-04-19T05:13:59.983748Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(scalogram_magn)\nprint(scalogram_magn.shape)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:13:59.987872Z","iopub.execute_input":"2024-04-19T05:13:59.988281Z","iopub.status.idle":"2024-04-19T05:14:00.002023Z","shell.execute_reply.started":"2024-04-19T05:13:59.988252Z","shell.execute_reply":"2024-04-19T05:14:00.000086Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,6))\nplt.imshow(scalogram_real, aspect='auto', cmap='jet', extent=[0, 603073, 0, 500])\nplt.colorbar(label='Magnitude')\nplt.title('Scalogram')\nplt.xlabel('Time')\nplt.ylabel('Scale')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:14:00.003880Z","iopub.execute_input":"2024-04-19T05:14:00.004293Z","iopub.status.idle":"2024-04-19T05:14:14.321331Z","shell.execute_reply.started":"2024-04-19T05:14:00.004259Z","shell.execute_reply":"2024-04-19T05:14:14.320005Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\nplt.figure(figsize=(20,6))\n\nplt.imshow(tf.transpose(scalogram_magn), aspect='auto', cmap='turbo', extent=[0, 603073, 0, 500])\n\nplt.title('Scalogram')\nplt.xlabel('Time')\nplt.ylabel('Scale')\nplt.show()\n\n","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:15:48.327593Z","iopub.execute_input":"2024-04-19T05:15:48.328029Z","iopub.status.idle":"2024-04-19T05:16:03.050339Z","shell.execute_reply.started":"2024-04-19T05:15:48.328003Z","shell.execute_reply":"2024-04-19T05:16:03.049144Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\nscalogram_reshaped = tf.reshape(tf.transpose(scalogram_magn), (500, 603073, 1))\nmax_value = tf.reduce_max(scalogram_magn)\nprint(max_value)\nmin_value = tf.reduce_min(scalogram_magn)\nprint(min_value)\nscalogram_magn_norm = (scalogram_reshaped - min_value) / (max_value - min_value)\n\nprint(scalogram_magn_norm.shape)\n\n\nflat_turbo_data = [item for sublist in turbo_data for item in sublist]\nprint(len(flat_turbo_data))\ntf_turbo_data = tf.constant(flat_turbo_data, dtype=tf.float32)\nprint(tf_turbo_data.shape)\nprint(tf_turbo_data.dtype)\n\nscalo_squeezed = tf.squeeze(scalogram_magn_norm, axis=-1)\nprint(scalo_squeezed.shape)\n#scalo_indices = tf.compat.v1.to_int32(tf.round(scalo_squeezed * 255))\nscalo_indices = tf.cast(tf.math.round(scalo_squeezed * 255), dtype=tf.int32)\nprint(scalo_indices)\nprint(scalo_indices.shape)\n\n\ncolors = tf.constant(tf_turbo_data, dtype=tf.float32)\nscalo_image = tf.gather(tf_turbo_data, scalo_indices)\n#print(scalo_image)\nprint(scalo_image.shape)\n\n#plt.imshow(scalogram_magn_norm, aspect='auto')\n#scalogram_rgb = tf.image.grayscale_to_rgb(scalo_image)\n#scalogram_hsv= tf.image.rgb_to_hsv(scalogram_rgb)\nplt.figure(figsize=(20,8))\nplt.imshow(scalo_image, aspect='auto')\n#print(scalogram_rgb.shape)\n\n","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:18:14.587137Z","iopub.execute_input":"2024-04-19T05:18:14.587942Z","iopub.status.idle":"2024-04-19T05:19:53.173218Z","shell.execute_reply.started":"2024-04-19T05:18:14.587896Z","shell.execute_reply":"2024-04-19T05:19:53.171953Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\nscalogram_real_f = scalogram[:, :, :, 0]\nscalogram_imag_f = scalogram[:, :, :, 1]\nscalogram_magn_f = tf.sqrt(scalogram_real_f ** 2 + scalogram_imag_f ** 2)\nprint(scalogram_magn_f.shape)\n\n","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:19:53.175244Z","iopub.execute_input":"2024-04-19T05:19:53.175697Z","iopub.status.idle":"2024-04-19T05:20:01.308781Z","shell.execute_reply.started":"2024-04-19T05:19:53.175663Z","shell.execute_reply":"2024-04-19T05:20:01.307567Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scalogram_reshaped = tf.transpose(scalogram_magn_f,perm=[2, 1,0])\nprint(scalogram_reshaped.shape)\n\n#scalogram_reshaped = tf.transpose(scalogram_magn_norm,perm=[1,2,0])\n#print(scalogram_reshaped)\nmagnitude_db_resized = tf.image.resize(scalogram_reshaped, [256, 256])\nprint(magnitude_db_resized.shape)\nmagnitude_db_resized = tf.transpose(magnitude_db_resized,perm=[2,0,1])\nprint(magnitude_db_resized.shape)\nmagnitude_db_resized = tf.expand_dims(magnitude_db_resized,axis=-1)\nprint(magnitude_db_resized.shape)\n\nmax_value = tf.reduce_max(scalogram_magn_f)\nprint(max_value)\nmin_value = tf.reduce_min(scalogram_magn_f)\nprint(min_value)       \nscalogram_magn_norm_f = (magnitude_db_resized - min_value) / (max_value - min_value)\n\nprint(scalogram_magn_norm.shape)\nflat_turbo_data = [item for sublist in turbo_data for item in sublist]\nprint(len(flat_turbo_data))\ntf_turbo_data = tf.constant(flat_turbo_data, dtype=tf.float32)\nprint(tf_turbo_data.shape)\nprint(tf_turbo_data.dtype)\n\nscalo_squeezed = tf.squeeze(scalogram_magn_norm_f, axis=-1)\nprint(scalo_squeezed.shape)\n##scalo_indices = tf.compat.v1.to_int32(tf.round(scalo_squeezed * 255))\nscalo_indices = tf.cast(tf.math.round(scalo_squeezed * 255), dtype=tf.int32)\nprint(scalo_indices.dtype)\nprint(scalo_indices.shape)\n\n\n#colors = tf.constant(tf_turbo_data, dtype=tf.float32)\nscalo_image = tf.gather(tf_turbo_data, scalo_indices)\n# #print(scalo_image)\nprint(scalo_image.shape)\n\n# #plt.imshow(scalogram_magn_norm, aspect='auto')\n# #scalogram_rgb = tf.image.grayscale_to_rgb(scalo_image)\n# #scalogram_hsv= tf.image.rgb_to_hsv(scalogram_rgb)\nplt.figure(figsize=(20,8))\nplt.imshow(scalo_image[0], aspect='auto')","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:20:01.310237Z","iopub.execute_input":"2024-04-19T05:20:01.310659Z","iopub.status.idle":"2024-04-19T05:20:04.854827Z","shell.execute_reply.started":"2024-04-19T05:20:01.310628Z","shell.execute_reply":"2024-04-19T05:20:04.853936Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def calculate_scales(wavelet='morl', frequency=rate, sampling_period=0.002):\n    scales = pywt.scale2frequency(wavelet, np.arange(1, 32))/sampling_period\n    target_scale = pywt.scale2frequency(wavelet, frequency)/sampling_period\n    \n    return scales /target_scale\n\n\nscale = calculate_scales()\ncoefficients, frequencies = pywt.cwt(audio_speech, scales=scale, wavelet = 'morl', method='fft')\nplt.figure(figsize=(20, 8))\nplt.imshow(np.abs(coefficients), aspect='auto', cmap='jet',\n          extent=[0, 5000, min(frequencies), max(frequencies)])\nprint(frequencies)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:17:02.662969Z","iopub.execute_input":"2024-04-19T05:17:02.663740Z","iopub.status.idle":"2024-04-19T05:17:22.923065Z","shell.execute_reply.started":"2024-04-19T05:17:02.663696Z","shell.execute_reply":"2024-04-19T05:17:22.922048Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"rate","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:21:23.747782Z","iopub.execute_input":"2024-04-19T05:21:23.748822Z","iopub.status.idle":"2024-04-19T05:21:23.756898Z","shell.execute_reply.started":"2024-04-19T05:21:23.748778Z","shell.execute_reply":"2024-04-19T05:21:23.755628Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def calculate_scales(wavelet='morl', frequency=rate, sampling_period=4.535e-5):\n    scales = pywt.scale2frequency(wavelet, np.arange(1, 64))/sampling_period\n    #target_scale = pywt.scale2frequency(wavelet, frequency)/sampling_period\n    \n    return scales \n\n\nscale = calculate_scales()\ncoefficients, frequencies = pywt.cwt(audio_speech, scales=scale, wavelet = 'morl', method='conv')\nplt.imshow(np.abs(coefficients), aspect='auto', cmap='jet',\n          extent=[0, 5000, min(frequencies), max(frequencies)])\nprint(frequencies)","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:22:00.633612Z","iopub.execute_input":"2024-04-19T05:22:00.634424Z","iopub.status.idle":"2024-04-19T05:24:08.004115Z","shell.execute_reply.started":"2024-04-19T05:22:00.634376Z","shell.execute_reply":"2024-04-19T05:24:08.002725Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\n\ndef calculate_scales(wavelet='cmor2.5-1.0', frequency=rate, sampling_period=4.535e-5):\n    scales = pywt.scale2frequency(wavelet, np.arange(1, 32))/sampling_period\n    #target_scale = pywt.scale2frequency(wavelet, frequency)/sampling_period\n    \n    return scales \n\n\nscale = calculate_scales()\ncoefficients, frequencies = pywt.cwt(audio_speech, scales=scale, wavelet = 'cmor2.5-1.0', method='conv')\nplt.figure(figsize=(20, 8))\nplt.imshow(np.abs(coefficients), aspect='auto', cmap='jet',\n          extent=[0, 5000, min(frequencies), max(frequencies)])\nprint(frequencies)\n\n","metadata":{"execution":{"iopub.status.busy":"2024-04-19T05:27:45.212945Z","iopub.execute_input":"2024-04-19T05:27:45.213423Z","iopub.status.idle":"2024-04-19T05:32:57.105302Z","shell.execute_reply.started":"2024-04-19T05:27:45.213394Z","shell.execute_reply":"2024-04-19T05:32:57.103793Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}