Module sig
[frames] | no frames]

Module sig

Signals, represented implicitly, with plotting and combinations.

Classes
  Signal
Represent infinite signals.
  CosineSignal
Primitive family of sinusoidal signals.
  UnitSampleSignal
Primitive unit sample signal has value 1 at time 0 and value 0 elsewhere.
  ConstantSignal
Primitive constant sample signal.
  SummedSignal
Sum of two signals
  ScaledSignal
Signal multiplied everywhere by a constant
  R
Signal delayed by one time step, so that R(S).sample(n+1) = S.sample(n)
  Rn
Signal delayed by several time steps
  FilteredSignal
Signal filtered by a function, applied to a fixed-sized window of previous values
  StepSignal
Signal that has value 1 for all n >= 0, and value 0 otherwise.
  ListSignal
Signal defined with a specific list of sample values, from 0 to some fixed length; It has value 0 elsewhere.
  ListSignalSampled
Signal defined with a specific list of sample values, from 0 to some fixed length; It has the last value past the end and the first value before the start.
Functions
 
gaps(data)
Return a list of the gap sizes, given a list of numbers.
 
polyR(s, p)
Returns: New signal that is s transformed by p interpreted as a polynomial in R.
 
meanFiltered(s, k)
Returns: s filtered with a mean filter of size k
 
listMean(vals)
Returns: mean of vals
 
makeSignalFromPickle(pathName)
Returns: ListSignal with data read in from pathname.
Variables
  graphwidth = 570
  graphheight = 300
  us = UnitSampleSignal()
Unit sample signal instance
  cubicinterpolation = False
  __package__ = None
Function Details

gaps(data)

 

Return a list of the gap sizes, given a list of numbers. (If input is length n, result is length n-1)

polyR(s, p)

 
Parameters:
  • s - Signal
  • p - poly.Polynomial
Returns:
New signal that is s transformed by p interpreted as a polynomial in R.

meanFiltered(s, k)

 
Parameters:
  • s - Signal
  • k - positive integer filter size
Returns:
s filtered with a mean filter of size k

listMean(vals)

 
Parameters:
  • vals - list of numbers
Returns:
mean of vals

makeSignalFromPickle(pathName)

 
Parameters:
  • pathName - string specifying directory and file name
Returns:
ListSignal with data read in from pathname. That path must contain a pickled list of numbers.