next up previous contents index
Next: Two-dimensional wavelet Up: One-dimensional wavelet Previous: Related file (external) types   Contents   Index


Functions Summary

The following is a description of all the functions related to the Wtrans1d type. The list is in alphabetical order.

$ \bigcirc$Name


mw_alloc_biortho_wtrans1d - Allocate the arrays of the decomposition




$ \bigcirc$Summary


void *mw_alloc_biortho_wtrans1d(wtrans,level,size)

Wtrans1d wtrans;

int level;

int size;




$ \bigcirc$Description


This function allocates the arrays A and D of a Wtrans1d structure previously created using mw_new_wtrans1d, in order to receive an biorthonormal wavelet representation (one voice per octave, decimation along the time axis). Each signal A[l][v] and D[l][v] for l = 0...nlevel, v = 0...nvoice - 1 ( (l, v) $ \not=$(0, 0)) is created and allocated to the right size. Previously allocations are deleted, if any.

The number of levels for the decomposition is given by level and the size of the original signal is given by size.

The arrays A and D can be addressed after this call, if the allocation successed. There is no default values for the signals. The type field of the Wtrans1d structure is set to mw_biorthogonal.

The function mw_alloc_biortho_wtrans1d returns NULL if not enough memory is available to allocate one of the signals. Your code should check this return value to send an error message in the NULL case, and do appropriate statement.

Notice that, if the wavelet transform is an output of a MegaWave2 module, the structure has been already created by the compiler if needed (See Volume one: ``MegaWave2 User's Guide''): do not perform additional call to mw_new_wtrans1d (see example below).




$ \bigcirc$Example

Wtrans1d Output; /* optional Output of the module */
Fsignal Signal;  /* needed Input of the module: original signal */
int J;           /* internal use */

if (Output) 
{
  /* Output requested : allocate Output for 8 levels of decomposition */
  if(mw_alloc_biortho_wtrans1d(Output, 8, Signal->size)==NULL)
    mwerror(FATAL,1,"Not enough memory.\n");
  
  Output->A[0][0] = Signal;
  for (J = 1; J <= 8; J++)
  {
     .
     . (Computation of the voice #J)
     .
  }
}

$ \bigcirc$Name


mw_alloc_continuous_wtrans1d - Allocate the arrays of the decomposition




$ \bigcirc$Summary


void *mw_alloc_continuous_wtrans1d(wtrans,level,voice,size,complex)

Wtrans1d wtrans;

int level;

int voice;

int size;

int complex;




$ \bigcirc$Description


This function allocates the arrays D of a Wtrans1d structure previously created using mw_new_wtrans1d, in order to receive an continuous wavelet representation (several voices per octave, no decimation along the time axis, wavelet with complex or real values). The arrays DP are allocated if complex is set to 1. Each signal D[l][v] (and DP[l][v] in the complex case) for l = 0...nlevel, v = 0...nvoice - 1 ( (l, v) $ \not=$(0, 0)) is created and allocated to the right size. Previously allocations are deleted, if any. Notice that, at this time, there is no function to allocate a continuous wavelet transform recording the low-pass signals (A and AP).

The number of levels for the decomposition is given by level, the number of voice per octave is given by voice and the size of the original signal is given by size.

The arrays D and DP can be addressed after this call, if the allocation successed. There is no default values for the signals. The type field of the Wtrans1d structure is set to mw_continuous.

The function mw_alloc_continuous_wtrans1d returns NULL if not enough memory is available to allocate one of the signals. Your code should check this return value to send an error message in the NULL case, and do appropriate statement.

Notice that, if the wavelet transform is an output of a MegaWave2 module, the structure has been already created by the compiler if needed (See Volume one: ``MegaWave2 User's Guide''): do not perform additional call to mw_new_wtrans1d (see example below).




$ \bigcirc$Example

Wtrans1d Output; /* optional Output of the module */
Fsignal Signal;  /* needed Input of the module: original signal */
int J;           /* internal use */

if (Output) 
{
  /* Output requested : allocate Output for 8 levels of decomposition
                        and 10 voices per octave, complex wavelet.
   */
  if(mw_alloc_continuous_wtrans1d(Output, 8, 10, Signal->size,1)==NULL)
    mwerror(FATAL,1,"Not enough memory.\n");
  
  for (J = 1; J <= 8; J++)
  {
     .
     . (Computation of the voice #J)
     .
  }
}

$ \bigcirc$Name


mw_alloc_dyadic_wtrans1d - Allocate the arrays of the decomposition




$ \bigcirc$Summary


void *mw_alloc_dyadic_wtrans1d(wtrans,level,size)

Wtrans1d wtrans;

int level;

int size;




$ \bigcirc$Description


This function allocates the arrays A and D of a Wtrans1d structure previously created using mw_new_wtrans1d, in order to receive an dyadic wavelet representation (one voice per octave, no decimation along the time axis). Each signal A[l][v] and D[l][v] for l = 0...nlevel, v = 0...nvoice - 1 ( (l, v) $ \not=$(0, 0)) is created and allocated to the right size. Previously allocations are deleted, if any.

The number of levels for the decomposition is given by level and the size of the original signal is given by size.

The arrays A and D can be addressed after this call, if the allocation successed. There is no default values for the signals. The type field of the Wtrans1d structure is set to mw_dyadic.

The function mw_alloc_dyadic_wtrans1d returns NULL if not enough memory is available to allocate one of the signals. Your code should check this return value to send an error message in the NULL case, and do appropriate statement.

Notice that, if the wavelet transform is an output of a MegaWave2 module, the structure has been already created by the compiler if needed (See Volume one: ``MegaWave2 User's Guide''): do not perform additional call to mw_new_wtrans1d (see example below).




$ \bigcirc$Example

Wtrans1d Output; /* optional Output of the module */
Fsignal Signal;  /* needed Input of the module: original signal */
int J;           /* internal use */

if (Output) 
{
  /* Output requested : allocate Output for 8 levels of decomposition */
  if(mw_alloc_dyadic_wtrans1d(Output, 8, Signal->size)==NULL)
    mwerror(FATAL,1,"Not enough memory.\n");
  
  Output->A[0][0] = Signal;
  for (J = 1; J <= 8; J++)
  {
     .
     . (Computation of the voice #J)
     .
  }
}

$ \bigcirc$Name


mw_alloc_ortho_wtrans1d - Allocate the arrays of the decomposition




$ \bigcirc$Summary


void *mw_alloc_ortho_wtrans1d(wtrans,level,size)

Wtrans1d wtrans;

int level;

int size;




$ \bigcirc$Description


This function allocates the arrays A and D of a Wtrans1d structure previously created using mw_new_wtrans1d, in order to receive an orthonormal wavelet representation (one voice per octave, decimation along the time axis). Each signal A[l][v] and D[l][v] for l = 0...nlevel, v = 0...nvoice - 1 ( (l, v) $ \not=$(0, 0)) is created and allocated to the right size. Previously allocations are deleted, if any.

The number of levels for the decomposition is given by level and the size of the original signal is given by size.

The arrays A and D can be addressed after this call, if the allocation successed. There is no default values for the signals. The type field of the Wtrans1d structure is set to mw_orthogonal.

The function mw_alloc_ortho_wtrans1d returns NULL if not enough memory is available to allocate one of the signals. Your code should check this return value to send an error message in the NULL case, and do appropriate statement.

Notice that, if the wavelet transform is an output of a MegaWave2 module, the structure has been already created by the compiler if needed (See Volume one: ``MegaWave2 User's Guide''): do not perform additional call to mw_new_wtrans1d (see example below).




$ \bigcirc$Example

Wtrans1d Output; /* optional Output of the module */
Fsignal Signal;  /* needed Input of the module: original signal */
int J;           /* internal use */

if (Output) 
{
  /* Output requested : allocate Output for 8 levels of decomposition */
  if(mw_alloc_ortho_wtrans1d(Output, 8, Signal->size)==NULL)
    mwerror(FATAL,1,"Not enough memory.\n");
  
  Output->A[0][0] = Signal;
  for (J = 1; J <= 8; J++)
  {
     .
     . (Computation of the voice #J)
     .
  }
}

$ \bigcirc$Name


mw_delete_wtrans1d - Deallocate the wavelet transform space




$ \bigcirc$Summary


void mw_delete_wtrans1d(wtrans)

Wtrans1d wtrans;




$ \bigcirc$Description


This function deallocates the memory used by the wavelet transform space wtrans that is, all the memory used by the arrays of signals A, AP, D, DP (if any), and the structure itself.

You should set wtrans = NULL after this call since the address pointed by wtrans is no longer valid.




$ \bigcirc$Example

Wtrans1d wtrans=NULL; /* Internal use: no Input neither Output of module */

if  ( ((wtrans = mw_new_wtrans1d()) == NULL) ||  
       (mw_alloc_ortho_wtrans1d(wtrans, 8, 1024)==NULL) )
    mwerror(FATAL,1,"Not enough memory.\n");
.
.
.
mw_delete_wtrans1d(wtrans);
wtrans = NULL;

$ \bigcirc$Name


mw_new_wtrans1d - Create a new Wtrans1d




$ \bigcirc$Summary


Wtrans1d mw_new_wtrans1d();




$ \bigcirc$Description


This function creates a new Wtrans1d structure with empty arrays of signals A, AP, D, DP. No signal can be addressed at this time. The arrays of signals should be allocated using one of the functions mw_alloc_X_wtrans1d where X depends of the type of the transformation.

You don't need this function for input/output of modules, since the MegaWave2 Compiler already created the structure for you if you need it (See Volume one: ``MegaWave2 User's Guide''). This function is used to create internal variables. Do not forget to deallocate the internal structures before the end of the module.

The function mw_new_wtrans1d returns NULL if not enough memory is available to create the structure. Your code should check this value to send an error message in the NULL case, and do appropriate statement.




$ \bigcirc$Example

Wtrans1d wtrans=NULL; /* Internal use: no Input neither Output of module */

if  ( ((wtrans = mw_new_wtrans1d()) == NULL) ||  
       (mw_alloc_continuous_wtrans1d(wtrans, 8, 10, 1024)) )
    mwerror(FATAL,1,"Not enough memory.\n");


next up previous contents index
Next: Two-dimensional wavelet Up: One-dimensional wavelet Previous: Related file (external) types   Contents   Index
mw 2004-05-05