Description

Embed Size (px)

DESCRIPTION

sdagsagd

Citation preview

So, how does this filter work? Our goal is to extract the reference current. Reference current is the harmonic of the frequency of 60 Hz. So, we must do an FFT to get the harmonic content. To be more precise, we're doing a STFT - Short Time Fourier Transform. It is a FFT where the dataset keeps changing. We're splitting our signal into windows and doing an FFT on each one of them. Since we're trying to get the magnitude at the 60Hz, we need our frequency resolution to be smaller than that. After doing the calculation, we figure out that we need to take at least 32768 samples to get the needed frequency resolution, but we decide to take 32768*2=65536 samples to get a better frequency resolution. That will also be the size of our window and of our FFT. Matlab has an inbuilt STFT block which simplifies things. The block does buffering (it collects samples until 65536 samples are connected and then it does the calculation). Normally, we would end up with 65536 FFT values, however, the only value that is chosen is the value which corresponds to the 60Hz bin. That is done with the selector block. STFT block outputs all the bins, and selector block chooses only the bin at the 9th index. That corresponds to 60Hz. After that, scaling to input magnitude is done. That is done by dividing the sum of hamming window (Which is used here as a window function) and also multiplying by 2 to get the single side spectrum. From that, magnitude and phase are obtained via the complex to magnitude-angle block. It is easy to reconstruct the reference signal then. Concerning STFT, overlap of 65536-256 samples is used. Which means that a new FFT is obtained every 256 samples. It is visible from the error plot that the active filter cannot react instantly to the load change. It has to collect 65536 samples for it to fully compensate the error.