# FiW

The function FiW computes the defect FFqmF = FF(qROI) - FmeasDelta and the adjoint of the Frechet derivative applied to the defect in the context of discrete wavelet transform.

## Contents

- Syntax
- Description
- Input Arguments
- Output Arguments
- More About
- See Also
- Code

## Syntax

    [FFqmF, DH] = FiW(qROI,FmeasDelta,seti,iW,iWStar)

## Description

`[FFqmF, DH] = FiW(qROI,FmeasDelta,seti,iW,iWStar)` computes the defect `FFqmF = FF(qROI) - FmeasDelta` and the adjoint of the Fréchet derivative applied to the defect. In this routine the latter is in dependence of the transformed contrast `qROI` by discrete wavelet transform; afterwards it is transformed back. Therefore it is the analog of `mimo` (in the case of `'adjOfDer'`). The details are in "More About".

## Input Arguments

- `qROI` : Contrast
- `FmeasDelta` : Data with noise
- `seti` : Structure array (mutable data structure of IPscatt)
- `iW` : Inverse wavelet transform (currently unused in this routine)
- `iWStar` : Adjoint of the inverse wavelet transform

## Output Arguments

- `FFqmF` : Defect, i.e. the difference between the predicted data , that bases on the reconstructed contrast , and the given data `FmeasDelta`.
- `DH` : Adjoint of the Fréchet derivative applied to the defect in the context of discrete wavelet transform, i.e. defect H(Wq) := | F(iW( Wq )) - y |_HS, see below for details.

## More About

The function `FiW` is used in the routine `minShrink`.

The input arguments `iW` and `iWStar` may be weighted in the routine `setWavelet`.

`FiW` as analog of `mimo`

As already mentioned the function `FiW` is the analog of `mimo` (in the case of `'adjOfDer'`), i.e. computes the defect and the adjoint of the Fréchet derivative applied to the defect. In contrast to `mimo` the defect is in dependence of the transformed contrast `qROI` by discrete wavelet transform and transformed back after the computation of the adjoint.

To make this point clear we compare both formulations in the following.

As notation we use:

- y := `FmeasDelta`
- q := `qROI`
- F := `FF` (forward operator )
- HS : Hilbert-Schmidt norm
- W : discrete wavelet transform
- iW : inverse wavelet transform

In the case of `mimo` (in the case `'adjOfDer'`) the defect is:

G(q) := | F( q ) - y |_HS

In the case of `FiW` the defect is in the context of discrete wavelet transform, i.e.

H(Wq) := | F(iW( Wq )) - y |_HS

The adjoint of the derivative is

iWStar[DF(iWq(Wq))]^*[ F(iW(Wq)) - y ]

respectively

iWStar[DF(q)]^*[ F(q) - y ] = iWStar(mimo(q)(2)) = DH

Of course, the defect in dependence of Wq is dWq = F(iW( Wq )) - y = F(q) - y.

Note that `mimo(q)(2)` describes the secound output argument of the routine `mimo`.

## See Also

- minShrink.html
- setWavelet.html
- ldwt.htm
- mimo.html

## Code

    function [FFqmF, DH] = FiW(qROI,FmeasDelta,seti,iW,iWStar)
    %
    % Update information:
    %
    % FFWqy = FF(q)-F (because input q and not Wq followed by q = iW(Wq) any more).
    % That is why |iW| is needless.
    %
    if nargout == 2
        [FFqmF, DG] = mimo(seti, qROI, FmeasDelta,'adjOfDer');
        DH = iWStar(DG);
    else
        FFqMeas = mimo(seti, qROI, 'simo');
        FFqmF = FFqMeas - FmeasDelta;
    end

    end