Package wiat :: Module Data
[hide private]
[frames] | no frames]

Module Data

source code

Data.py - Functions to load data from Matlab files and to interpolate the frequency and magnitude of the maxima.

Classes [hide private]
  __Parabola
Class for fiting an equation of the form y = ax**2 + bx + c
Functions [hide private]
 
load_from_mat(names, filename)
Load data from a matlab file.
source code
 
interpolate_maxima(f, Z, number_of_maxima=None, fmin=100.0)
Find the maxima in the data and interpolate with Parbola to find the frequency and amplitude of the maxima.
source code
Function Details [hide private]

load_from_mat(names, filename)

source code 

Load data from a matlab file. All variable name in the names tuple are fetched and returned .

Example:


>>> import os
>>> import numpy
>>> import wiat
>>> f,z = wiat.Data.load_from_mat(('freqs','z'),
...    os.path.join(wiat.MEASUREMENTDIR,'20080412Ztoneholeless.mat'))
>>> numpy.size(f) == numpy.size(z)
True
Parameters:
  • names - A tuple containing variable names to get from the Matlab file.
  • filename - the path to the Matlab file
Returns:
a list of the extracted arrays. None if the name do not exist.

interpolate_maxima(f, Z, number_of_maxima=None, fmin=100.0)

source code 

Find the maxima in the data and interpolate with Parbola to find the frequency and amplitude of the maxima.

Results that are noisy are likely to pose problems to the algorithm.

Parameters:
  • fmin - minimal frequency we are interested in, useful to avoid low frequency noise to infect the results.