Skip to content

Commit

Permalink
mode specific gain
Browse files Browse the repository at this point in the history
  • Loading branch information
oguyon committed Jan 11, 2022
1 parent bea9b40 commit d1c4f4a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions AOloopControl/modalfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@


// Local variables pointers
static int AOloopindex = 0;

static char *inmval;
long fpi_inmval;

Expand Down Expand Up @@ -153,19 +155,25 @@ static errno_t compute_function()

// create output mode coeffs
imageID IDoutmval;
imageID IDmodegainfact;
{
uint32_t naxes[2];
naxes[0] = imgin.md->size[0];
naxes[1] = 1;

char modegfname[STRINGMAXLEN_STREAMNAME];
WRITE_IMAGENAME(modegfname, "aol%d_modevalgain", AOloopindex);

create_image_ID( outmval, 2, naxes, imgin.datatype, 1, 0, 0, &IDoutmval);
create_image_ID( modegfname, 2, naxes, imgin.datatype, 1, 0, 0, &IDmodegainfact);
}

for(uint32_t mi=0; mi<NBmode; mi++)
{
data.image[IDoutmval].array.F[mi] = 0.0;
mvalout[mi] = 0.0;
avemval[mi] = 0.0;
data.image[IDmodegainfact].array.F[mi] = 1.0;
}

float avegain = 1.0 / (*avets);
Expand All @@ -181,6 +189,7 @@ static errno_t compute_function()

float gain = (*loopgain);
gain *= pow( (*galpha), x);
gain *= data.image[IDmodegainfact].array.F[mi];

if(mi > (*mimax))
{
Expand All @@ -200,6 +209,7 @@ static errno_t compute_function()
}
*/


avemval[mi] = (1.0-avegain)*avemval[mi] + avegain * (imgin.im->array.F[mi] * gain);


Expand Down

0 comments on commit d1c4f4a

Please sign in to comment.