Skip to content

Instantly share code, notes, and snippets.

View denisb411's full-sized avatar

Denis Candido denisb411

  • Campinas - SP, Brazil
View GitHub Profile
@denisb411
denisb411 / plot_mic_fft.py
Created May 3, 2017 12:39
Real time microphone analysis. Real time plot of signal and FFT using numpy, matplotlib and pyaudio
import pyaudio
import numpy as np
import time
import wave
import matplotlib.pyplot as plt
# open stream
FORMAT = pyaudio.paInt16
CHANNELS = 1
@denisb411
denisb411 / CustomAKFFTTap.swift
Last active June 19, 2017 12:26
Custom AKFFTTap. Improved the FFT resolution by increasing hte bufferSize.
import Foundation
import AudioKit
/// FFT Calculation for any node
@objc open class CustomAKFFTTap: NSObject, EZAudioFFTDelegate {
internal let bufferSize: UInt32 = 512 //old: 1024
internal var fft: EZAudioFFT?
@denisb411
denisb411 / samples_test.py
Created June 1, 2017 14:36
Python code that collects the audio input samples
import pyaudio
import numpy as np
import time
import wave
import matplotlib.pyplot as plt
# open stream
FORMAT = pyaudio.paInt16
CHANNELS = 1
@denisb411
denisb411 / MicrophoneTracker.swift
Last active November 29, 2017 08:50
An swift iOS class that tracks the microphone fundamental frequency, max amplitude and the microphone samples. Uses the AudioKit framework.
//
// StandardGuitarViewController.swift
// Universal_Tuner
//
// Created by Denis França Candido on 01/04/17.
// Copyright © 2017 Denis França Candido. All rights reserved.
//
import Foundation
import UIKit
import os
import librosa.display
import numpy as np
import pandas as pd
import tensorflow as tf
df = pd.read_csv('samples_nylonGuitar_1024_Mm7_R03.csv')
X_load = np.array(df.iloc[:,:-1], dtype=np.float)
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <pthread.h>
#include <float.h>
#include <time.h>
#include <mpi.h>
#define MASTER 0
#define N_TAREFAS 5
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <pthread.h>
#include <float.h>
#include <time.h>
#include <mpi.h>
#define MASTER 0
@denisb411
denisb411 / PST_messages_extractor.py
Last active January 30, 2024 23:20
Script used to extract messages from .pst file at json format
import os
import sys
import argparse
import json
from shutil import rmtree
import re
import pypff
sys.setrecursionlimit(10000)
@denisb411
denisb411 / .vimrc
Created April 13, 2018 19:27
Configured vimrc mainly for python development
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
@denisb411
denisb411 / zombie_matrix.c
Last active June 18, 2018 13:59
zombie exercices using matrix - c
#include <stdio.h>
#include <stdlib.h>
/* Trabalho - The Walking Dead
Algoritmos e Lógica de Programação e Matemática Discreta
Desenvolvedores:
Thainnara dos Santos RA: 2760481811013
Vitor Gonçalves RA: 2760481811016 */
#define VAZIO 0
#define HUMANO 1