# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# chgwdeccfs

Change multisignal 1-D decomposition coefficients

## Syntax

```DEC = chgwdeccfs(DEC,'ca',COEFS) DEC = chgwdeccfs(DEC,'cd',COEFS,LEV) DEC = chgwdeccfs(DEC,'all',CA,CD) DEC = chgwdeccfs(DEC,'all',V) DEC = chgwdeccfs(...,IDXSIG) ```

## Description

`DEC = chgwdeccfs(DEC,'ca',COEFS)` replaces the approximation coefficients at level `DEC.level` with those contained in the matrix `COEFS`. If `COEFS` is a single value `V`, all coefficients are replaced by `V`.

`DEC = chgwdeccfs(DEC,'cd',COEFS,LEV)` replaces the detail coefficients at level `LEV` with those contained in the matrix `COEFS`. If `COEFS` is a single value `V`, then `LEV` can be a vector of levels and all the coefficients that belong to these levels are replaced by `V`. `LEV` must be such that `1 `` LEV `` DEC.level`

`DEC = chgwdeccfs(DEC,'all',CA,CD)` replaces all the approximation and detail coefficients. `CA` must be a matrix and `CD` must be a cell array of length `DEC.level`.

If `COEFS` (or `CA` or `CD`) is a single number, then it replaces all the related coefficients. Otherwise, `COEFS` (or `CA`, or `CD`) must be a matrix of appropriate size.

For a real value `V`, ```DEC = chgwdeccfs(DEC,'all',V)``` replaces all the coefficients by `V`.

`DEC = chgwdeccfs(...,IDXSIG)` replaces the coefficients for the signals whose indices are given by the vector `IDXSIG`. If the initial data are stored row-wise or column-wise in a matrix `X`, then `IDXSIG` contains the row or column indices, respectively, of the data.

## Examples

```% Load original 1D-multisignal load thinker % Perform a decomposition at level 2 using wavelet db2 dec = mdwtdec('r',X,2,'db2'); % Change the coefficients of details at level 1. % Replace all values by 0. decBIS = chgwdeccfs(dec,'cd',0,1); % Change the coefficients of details at level 1 and % level 2 for signals 31 to 35. Replace all values by 0. decTER = chgwdeccfs(dec,'cd',0,1:2,31:35); % Compare original and new coefficients for details % at level 1 for signals 31 to 35. plot(dec.cd{1}(31:35,:)','b'); hold on; plot(decTER.cd{1}(31:35,:)','r') ```