sound.spectrogram
Class SignalProcessingUtils

java.lang.Object
  extended by sound.spectrogram.SignalProcessingUtils

public class SignalProcessingUtils
extends java.lang.Object

Created by IntelliJ IDEA. User: lopesg Date: Dec 10, 2006 Time: 4:08:51 PM To change this template use File | Settings | File Templates.


Constructor Summary
SignalProcessingUtils()
           
 
Method Summary
static void centering(double[] r)
           
static void checkInputSignal(DoubleAudio audioData, double signalPowerToFilter)
           
static double getAveragePower(double[] audioData)
           
static double getDeltaF(int sampleSize, double samplingFrequency)
           
static double getDeltaT(DoubleAudio audioData)
           
static void getFilteredSignal(double[] in_r, double zeroCutOff)
           
static int getMidiNoteNumber(double freq)
          This method will use the audio sample to compute the midi note number;
static int[] getNoteNumbers(int[] f)
           
static int[] getNStrongestFrequencies(double[] psd, int numberOfFrequencies)
          Sort the PSD to obtain the strongest frequencies then remove the duplicates, get the n strongest frequencies convert them to frequencies in Hz and return in an array of int.
static int[] getNStrongestFrequencies(double[] psd, int numberOfFrequencies, int samplingRate)
           
static int[] getNStrongestHarmonicLocations(double[] psd, int n)
           
static double[] getNStrongestHarmonics(double[] psd, int n)
           
static double[] getNStrongestHarmonicsTimes(double[] psd, int n, int offset)
           
static void getProcessedSignalSample(int windowNum, int sampleLength, double[] in_r)
          Takes the input data and only samples a window of data defined by the samplesize (i.e.
static double[] getSignalPSD(double[] in_r, int sampleStartPoint, int sampleLength)
           
static void main(java.lang.String[] args)
           
static void playMidiNote(double[] data)
           
static void processInputSignal(double[] data, int startPoint, int endPoint)
           
static void saveDouble(DoubleAudio audioData)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignalProcessingUtils

public SignalProcessingUtils()
Method Detail

centering

public static void centering(double[] r)

getNStrongestHarmonicsTimes

public static double[] getNStrongestHarmonicsTimes(double[] psd,
                                                   int n,
                                                   int offset)

getNStrongestFrequencies

public static int[] getNStrongestFrequencies(double[] psd,
                                             int numberOfFrequencies)
Sort the PSD to obtain the strongest frequencies then remove the duplicates, get the n strongest frequencies convert them to frequencies in Hz and return in an array of int.

Parameters:
psd - a double array on input
numberOfFrequencies - an int that must be smaller that psd.length/2
Returns:
get an arbitrary number of strong harmonic Frequencies

getNStrongestFrequencies

public static int[] getNStrongestFrequencies(double[] psd,
                                             int numberOfFrequencies,
                                             int samplingRate)

getNStrongestHarmonicLocations

public static int[] getNStrongestHarmonicLocations(double[] psd,
                                                   int n)

getNStrongestHarmonics

public static double[] getNStrongestHarmonics(double[] psd,
                                              int n)

getNoteNumbers

public static int[] getNoteNumbers(int[] f)

getDeltaF

public static double getDeltaF(int sampleSize,
                               double samplingFrequency)

getDeltaT

public static double getDeltaT(DoubleAudio audioData)

getAveragePower

public static double getAveragePower(double[] audioData)

getFilteredSignal

public static void getFilteredSignal(double[] in_r,
                                     double zeroCutOff)

getSignalPSD

public static double[] getSignalPSD(double[] in_r,
                                    int sampleStartPoint,
                                    int sampleLength)

saveDouble

public static void saveDouble(DoubleAudio audioData)

getProcessedSignalSample

public static void getProcessedSignalSample(int windowNum,
                                            int sampleLength,
                                            double[] in_r)
Takes the input data and only samples a window of data defined by the samplesize (i.e. 1 sec of data at 8 KHz sampling rate = 8000 samples or one window 8000 samples in length).

Parameters:
sampleLength - The size of the sampled data.
in_r - The input data to sample.

playMidiNote

public static void playMidiNote(double[] data)

processInputSignal

public static void processInputSignal(double[] data,
                                      int startPoint,
                                      int endPoint)

checkInputSignal

public static void checkInputSignal(DoubleAudio audioData,
                                    double signalPowerToFilter)

getMidiNoteNumber

public static int getMidiNoteNumber(double freq)
This method will use the audio sample to compute the midi note number;


main

public static void main(java.lang.String[] args)