notch filter 50 Hz

Hi
I am trying to make a 50 Hz notch filter, the last one in link, using stm32f103.
Here is my code, but I have on output only not modulated PWM, for pulse with is responsible this line" //pwmtimer1.setCompare(TIMER_CH1, 50); " changing the 50 to another number is changing the pulse width, I repleaced 50 by “output” which is not working.
What I am doing wrong ?

https://gist.github.com/cilliand/2674c9bd55960179e14d#file-filters-cpp

HardwareTimer pwmtimer1(1);
#define NZEROSNOTCH 8
#define NPOLESNOTCH 8
#define GAINNOTCH 1.136930320e+00

int sampleRate = 256;
int input = PA7;
int output = PA8; //T1C1
void setup()
{
  pinMode(PA7, INPUT);
  pinMode(PA8, PWM);


}

static float xvnotch[NZEROSNOTCH + 1], yvnotch[NPOLESNOTCH + 1];
static inline float filterNotch50Hz(float input);

void loop()

{

  pwmtimer1.pause();
  pwmtimer1.setPrescaleFactor(1);
  pwmtimer1.setOverflow(100);
  //pwmtimer1.setCompare(TIMER_CH1, 50);
  pwmtimer1.setCompare(TIMER_CH1, output); //
  pwmtimer1.resume();

  xvnotch[0] = xvnotch[1]; xvnotch[1] = xvnotch[2]; xvnotch[2] = xvnotch[3]; xvnotch[3] = xvnotch[4]; xvnotch[4] = xvnotch[5]; xvnotch[5] = xvnotch[6]; xvnotch[6] = xvnotch[7]; xvnotch[7] = xvnotch[8];
  xvnotch[8] = input / GAINNOTCH;
  yvnotch[0] = yvnotch[1]; yvnotch[1] = yvnotch[2]; yvnotch[2] = yvnotch[3]; yvnotch[3] = yvnotch[4]; yvnotch[4] = yvnotch[5]; yvnotch[5] = yvnotch[6]; yvnotch[6] = yvnotch[7]; yvnotch[7] = yvnotch[8];
  yvnotch[8] = (xvnotch[0] + xvnotch[8]) - 2.6983691309 * (xvnotch[1] + xvnotch[7]) + 6.7304484875 * (xvnotch[2] + xvnotch[6])
                 - 9.3230670449 * (xvnotch[3] + xvnotch[5]) + 11.6679900010 * xvnotch[4]
                 + ( -0.7736282195 * yvnotch[0]) + ( 2.1544643168 * yvnotch[1])
                 + ( -5.5436864413 * yvnotch[2]) + ( 7.9278080943 * yvnotch[3])
                 + (-10.2416524940 * yvnotch[4]) + ( 8.4530545984 * yvnotch[5])
                 + ( -6.3025540854 * yvnotch[6]) + ( 2.6118549514 * yvnotch[7]);
  // return yvnotch[8];
  output = int(yvnotch[8]);
}