jsci.maths.wavelet
Class Signal
- java.lang.Object
-
- jsci.maths.wavelet.MultiscaleFunction
-
- jsci.maths.wavelet.splines.Spline
-
- jsci.maths.wavelet.splines.LinearSpline
-
- jsci.maths.wavelet.Signal
-
- All Implemented Interfaces:
- java.lang.Cloneable, NumericalConstants, Filter
public class Signal extends LinearSpline implements NumericalConstants, java.lang.Cloneable
This class use the linear spline as a general model for a signal. While this is a reasonnable design choice, this can certainly be overwritten if necessary. Basic operations on signal are supported.
-
-
Field Summary
-
Fields inherited from interface jsci.maths.NumericalConstants
GAMMA, GOLDEN_RATIO, LOG10, SQRT2, SQRT2PI, TWO_PI
-
-
Constructor Summary
Constructors Constructor and Description Signal()Signal(double[] v)Signal(Filter f)Signal(Filter f, double[] v)Signal(Filter f, double[] v, double[] p)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]absFFT()Return the absolute value of the FFTstatic double[]absFFT(double[] data)java.lang.Objectclone()Return a copy of this objectvoiddenoiseByFFT(int k)Simplistic FFT denoising.SignaldenoiseShortPeaks(double p, int n)This denoising method will identify "short peaks" in the signal and take them away.doubleentropy()Return the entropy of the signalbooleanequals(Signal b)Check if another object is equal to this Signal objectComplex[]fft()static Complex[]fft(Complex[] data)Performs the Fourier transform.static Complex[]fft(double[] data)Performs the Fourier transform.static Complex[]fftInverse(Complex[] data)Also noted iFFT in other packages.Signalfilter(double[] f)Apply the given array as a convolution Filter and return a new Signal.FWTCoeffwt(int J)Fast Wavelet TransformFWTPacketCoeffwtPacket(int J, MappingND cout)The Fast Wavelet Transform with Wavelet packetsdouble[]getValues()Get the sampled values of the sample as an array.double[]highpassProject()Project the signal according the the highpass Filterdouble[]lowpassProject()Project the data according to the lowpass FilterSignalmedianFilter(int n)Apply the median Filter of a window of size 2*n+1.doublenorm()Compute the L2 norm of the signalvoidremoveParameters()Throws away the parameters of the Filtervoidresample(int newl)Resample the signal using linear interpolationvoidsetData(double[] v)Set the data for the signalvoidsetDimensionFromBeginning(int dimension)Will make the signal a given dimensionvoidsetDimensionFromEnd(int dimension)Will make the signal a given dimensionvoidsetFilter(Filter f)set the signal associated FiltervoidsetLengthFromBeginning(int longueur)Set the Signal to the specified length scraping or padding the end if necessaryvoidsetLengthFromEnd(int longueur)Set the Signal to the specified length scraping or padding the beginning if necessaryvoidsetParameters(double[] p)Set the parameter of the Filter (if it applies).voidsetParameters(java.lang.Double[] p)Set the parameters of the Filter (if it applies).-
Methods inherited from class jsci.maths.wavelet.splines.LinearSpline
derive, derive, dimension, dimension, equals, evaluate, getFilterType, getValue, highpass, highpass, interpolate, lowpass, lowpass, previousDimension, setValue, setValues, toString
-
Methods inherited from class jsci.maths.wavelet.MultiscaleFunction
mass, mass
-
-
-
-
Constructor Detail
-
Signal
public Signal()
-
Signal
public Signal(double[] v)
-
Signal
public Signal(Filter f, double[] v, double[] p)
-
Signal
public Signal(Filter f)
-
Signal
public Signal(Filter f, double[] v)
-
-
Method Detail
-
clone
public java.lang.Object clone()
Return a copy of this object- Overrides:
clonein classLinearSpline
-
getValues
public double[] getValues()
Get the sampled values of the sample as an array.
-
setFilter
public void setFilter(Filter f)
set the signal associated Filter
-
setParameters
public void setParameters(double[] p)
Set the parameter of the Filter (if it applies).
-
setParameters
public void setParameters(java.lang.Double[] p)
Set the parameters of the Filter (if it applies).
-
removeParameters
public void removeParameters()
Throws away the parameters of the Filter
-
setLengthFromEnd
public void setLengthFromEnd(int longueur)
Set the Signal to the specified length scraping or padding the beginning if necessary
-
resample
public void resample(int newl)
Resample the signal using linear interpolation
-
setLengthFromBeginning
public void setLengthFromBeginning(int longueur)
Set the Signal to the specified length scraping or padding the end if necessary
-
setData
public void setData(double[] v)
Set the data for the signal
-
fwt
public FWTCoef fwt(int J)
Fast Wavelet Transform
-
fwtPacket
public FWTPacketCoef fwtPacket(int J, MappingND cout)
The Fast Wavelet Transform with Wavelet packets- Parameters:
J- number of iterationscout- cost function
-
lowpassProject
public double[] lowpassProject()
Project the data according to the lowpass Filter
-
highpassProject
public double[] highpassProject()
Project the signal according the the highpass Filter
-
norm
public double norm()
Compute the L2 norm of the signal
-
fft
public Complex[] fft()
-
fft
public static Complex[] fft(double[] data)
Performs the Fourier transform. Convenience method forFourierMath.transform.
-
fft
public static Complex[] fft(Complex[] data)
Performs the Fourier transform. Convenience method forFourierMath.transform.
-
absFFT
public double[] absFFT()
Return the absolute value of the FFT
-
absFFT
public static double[] absFFT(double[] data)
-
fftInverse
public static Complex[] fftInverse(Complex[] data)
Also noted iFFT in other packages. This is the inverse to the FFT.
-
equals
public boolean equals(Signal b)
Check if another object is equal to this Signal object
-
setDimensionFromEnd
public void setDimensionFromEnd(int dimension)
Will make the signal a given dimension
-
setDimensionFromBeginning
public void setDimensionFromBeginning(int dimension)
Will make the signal a given dimension
-
denoiseByFFT
public void denoiseByFFT(int k)
Simplistic FFT denoising.- Parameters:
k- frequency to denoised
-
entropy
public double entropy()
Return the entropy of the signal
-
filter
public Signal filter(double[] f)
Apply the given array as a convolution Filter and return a new Signal. As one often want to compare the result to the original signal, this method is "safe", that is, it won't change the current object.- Parameters:
f- an array containing the coefficients of the convolution Filter
-
medianFilter
public Signal medianFilter(int n)
Apply the median Filter of a window of size 2*n+1. exception IllegalArgumentException if the parameter n is negative
-
denoiseShortPeaks
public Signal denoiseShortPeaks(double p, int n)
This denoising method will identify "short peaks" in the signal and take them away. Short peaks are defined from a comparison with the median filtered signal. Only "significative" peaks are detected (see parameter p). This method won't denoise near the boundaries. "Short" refers here to the time-domain and not the amplitude. param p percentage of the range (max-min) considered as a significative step param n length of the peak in the time domain exception IllegalArgumentException if p is not between 0 and 1 exception IllegalArgumentException if the parameter n is negative
-
-
DMelt 3.0 © DataMelt by jWork.ORG