Reduce FFT bins by oversampling
Show older comments
We measured the voltage output of a rotating machine (generator) which base frequency is 60 Hz. The acquisition sampling is 20 kHz. The generator frequency is varying in time (can be 60.1, 59.9, etc). My recording length is several minutes and I would like to trace the output frequency of the voltage over the time.
I made a sliding windows where I calculate an FFT over 2*334=668 samples, corresponding to 33.4 msec of approximately 2 cycles at 60 Hz.
With the FFT function, I am not able to acheive the precision of 1/10 Hz.
The frequency bins are 29.94 Hz, 59.88 Hz, 89.82 Hz, for a windows 2 cycles. In order to refine the bins, I will have to enlarge the windows, but it becomes so large that a fluctuation is no longer visible.
Am I missing something?
Is there another method that could be more suitable for the application?
load Va.mat %Contains the variable which is the generator output voltage
T = 50e-6; % Sampling period
Fs = 1/T; % Sampling frequency
L = 2*334; % Length of signal
t = (0:L-1)*T; % Time vector
iter = 5000; %Number of windows
sig = zeros(iter,3);
for i = 1:1:iter
S = Gen_volt_output(i:L+i-1,1); %Sample to be analysed
f = Fs*(0:(L/2))/L; %Freq. bins
Y = fft(S);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
[max_val,index] = max(P1);
frequence = f(index);
sig(i,1) = i;
sig(i,2) = frequence;
sig(i,3) = max_val/sqrt(2);
end
subplot(2,1,1)
plot(sig(:,2))
subplot(2,1,2)
hold on
plot(sig(:,3))
plot(Gen_volt_output(1:iter))
hold off
Accepted Answer
More Answers (0)
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!