Hello one and all!
I have been tasked to design and implement a APFC system using a boost converter. The circuit design is as follows:

I have decided to implement the system using a STM32-nucleo-f303re. Now for APFC algorithm itself I have decided to go with an Average Current Mode implementation to control the inductor current. Therefore, I have decided to implement 2 voltage sensors (one on the input and another on the output) and a current sensor before the inductor. Initially I had large problems when it came to the physical tuning of the system in code, due to the fact that I had a very messy and noisy signal to track. As can be seen in the following pictures.
The following picture is the Inductor current (blue) w.r.t current sensor (yellow)
The following picture is the full wave rectified signal (blue) w.r.t input voltage sensor (yellow)

As i tried to read these noisy signals in the ADC of my micro-controller, I could not get a stable enough reading to tune the sensors w.r.t to the mean voltage and current. I then decided to apply digital filter technique that made use of a weighted average filter (that averaged out 200 samples) and a low-pass filter (cut-off frequency of 150Hz). This was able to get my ADC values stable enough for tuning with only about a 1V difference from the actual measured signal. Now that I have successfully tuned my sensors to be able to sense the actual mean voltage and current signal, I seem to have a slight confusion. Now for an APFC system to work the inductor current would be required to emulate a scaled down version of the input rectified signal, in other words the inductor current would need to copy the shape of a scaled down full-wave rectified signal. So my question to my fellow competent engineers is, is there a way to digitally verify if the shape of the input voltage sensor matches that of the full-wave rectified signal and if the input current sensor matches that of the waveform as shown above? Your help in this matter will be highly appreciated.
I have been tasked to design and implement a APFC system using a boost converter. The circuit design is as follows:

I have decided to implement the system using a STM32-nucleo-f303re. Now for APFC algorithm itself I have decided to go with an Average Current Mode implementation to control the inductor current. Therefore, I have decided to implement 2 voltage sensors (one on the input and another on the output) and a current sensor before the inductor. Initially I had large problems when it came to the physical tuning of the system in code, due to the fact that I had a very messy and noisy signal to track. As can be seen in the following pictures.
The following picture is the Inductor current (blue) w.r.t current sensor (yellow)

The following picture is the full wave rectified signal (blue) w.r.t input voltage sensor (yellow)

As i tried to read these noisy signals in the ADC of my micro-controller, I could not get a stable enough reading to tune the sensors w.r.t to the mean voltage and current. I then decided to apply digital filter technique that made use of a weighted average filter (that averaged out 200 samples) and a low-pass filter (cut-off frequency of 150Hz). This was able to get my ADC values stable enough for tuning with only about a 1V difference from the actual measured signal. Now that I have successfully tuned my sensors to be able to sense the actual mean voltage and current signal, I seem to have a slight confusion. Now for an APFC system to work the inductor current would be required to emulate a scaled down version of the input rectified signal, in other words the inductor current would need to copy the shape of a scaled down full-wave rectified signal. So my question to my fellow competent engineers is, is there a way to digitally verify if the shape of the input voltage sensor matches that of the full-wave rectified signal and if the input current sensor matches that of the waveform as shown above? Your help in this matter will be highly appreciated.