fingerprint

package
v0.0.0-...-c1ec720 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNoise

func AddNoise(signal []float64)

func Bartlett

func Bartlett(signal []float64) []float64

Bartlett applies the Bartlett window function on the given signal.

func Compare

func Compare(sourceFP [][]int, destFP [][]int) float64

Compare compares two 2-D slice and return the match rate a.k.a the number of matching elements over the total number of elements.

func FFT

func FFT(signal []float64) []float64

FFT performs Fast Fourier Transform on the given signal.

func Fingerprint

func Fingerprint(filename string, winSize, hopSize int, windowFunction string, addNoise bool) [][]int

Fingerprint takes a .wav file and output its fingerprint.

func GetHighestMatchRate

func GetHighestMatchRate(sampleFilename string, sampleFingerprint [][]int, audioFilename string, audioFingerprint [][]int) float64

GetHighestMatchRate returns the highest match rate between the fingerprint of the sample and the fingerprint of the target audio.

func Hamming

func Hamming(signal []float64) []float64

Hamming applies the Hamming window function on the given signal.

func Hann

func Hann(signal []float64) []float64

Hann applies the Hann window function on the given signal.

func Spectrogram

func Spectrogram(signal *Signal, winSize, hopSize int, windowFunction string) [][]float64

Spectrogram returns the spectrogram of the input signal. Optional window function.

Types

type Signal

type Signal struct {
	SampleRate int
	Samples    []float64
}

func ReadWAV

func ReadWAV(filename string) *Signal

ReadWAV reads .wav file into slice of float64 samples.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL