This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import japanize_matplotlib | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from scipy import signal | |
# パラメータ設定 | |
fs = 1000 # サンプリング周波数 | |
t = np.arange(0, 1, 1 / fs) # 時間軸 | |
f0 = 5 # 基本周波数 | |
f1 = 10 # 周波数変調の上限 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import librosa | |
import numpy as np | |
import soundfile as sf | |
from scipy import signal | |
from scipy.io import wavfile | |
class AudioSteganography: | |
"""音声信号への画像埋め込みと復元.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Demonstration script of voice chatbot.""" | |
import os | |
import google.generativeai as genai | |
def main(): | |
"""Perform chat with Gemini.""" | |
genai.configure(api_key=os.environ["GEMINI_API_KEY"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Demonstration script for phase recovery via rational function approximation. | |
Copyright (C) 2024 by Akira TAMAMORI | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.pyright] | |
typeCheckingMode = "standard" | |
[tool.mypy] | |
strict = false | |
ignore_missing_imports = true | |
[tool.ruff] | |
# Exclude a variety of commonly ignored directories. | |
exclude = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; ruff-sort-imports.el --- Sort import libraries of Python source via Ruff -*- lexical-binding: t; -*- | |
;; Copyright (C) 2024 Akira Tamamori | |
;; Copyright (C) 2023 Ville Skyttä | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or | |
;; (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Demonstration script of phase reconstruction with PHASRET and oct2py. | |
Copyright (C) 2024 by Akira TAMAMORI | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import soundfile as sf | |
from oct2py import octave | |
from scipy import signal | |
WIN_LEN = 512 | |
HOP_LEN = 128 | |
FFT_LEN = 512 | |
WINDOW = "hann" | |
IN_WAV = "ONOMATOPEE300_001.wav" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
"""Wrapper modules of Gated Linear Unit (GLU). | |
Copyright (C) 2024 by Akira TAMAMORI | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# MIT License | |
# Copyright (C) 2024 by Akira TAMAMORI | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation files | |
# (the Software"), to deal in the Software without restriction, | |
# including without limitation the rights to use, copy, modify, merge, |
NewerOlder