This paper presents a real time hardware in the loop simulation system of a Shunt Active Power Filter (SAPF) for a three-phase four-wire Voltage Source Inverter (VSI). A digital signal processor starter kit TMS 320F2812 PGFA is chosen as control platform for the SAPF model, which is implemented in a dSPACE 1104. The system is focused on the DC bus voltage control and its purpose is to achieve and maintain a reference voltage level in each capacitor in order to guarantee both the active filter controllability and the balance in the distribution of the DC bus voltage. Direct comparison between real time simulation waveforms and Matlab/Simulink simulation signals are made to evaluate the effectiveness of the implemented system.