I have to do a order analysis for the electric motor. when i am doing the analysis there are lot of errors showing in my code. please help me to cmplete this analysis. my code is given below and i have attached a file.
NFFT = 2000; % then df = 1 Hz
OVERLAP = 0.75;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% load signal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[rpm, fs]=audioread('09_52_00.wav');
dt = 1/fs;
[samples,channels] = size(rpm);
% time vector
t = (0:samples-1)*dt;
vib = vib - mean(vib); % Remove the DC component
subplot(2,1,1)
plot(t,rpm) % Plot the motor rotational speed
xlabel('Time (s)')
ylabel('Engine Speed (RPM)')
title('Engine speed')
subplot(2,1,2)
plot(t,vib) % Plot the vibration signal
title('Accelerometer Vibration Data')
rpmfreqmap(vib,fs,rpm)
rpmfreqmap(vib,fs,rpm,1)
rpmordermap(vib,fs,rpm,0.005)
[map,mapOrder,mapRPM,mapTime] = rpmordermap(vib,fs,rpm,0.005);
figure
orderspectrum(map,mapOrder)
[spec,specOrder] = orderspectrum(map,mapOrder);
[~,peakOrders] = findpeaks(spec,specOrder,'SortStr','descend','NPeaks',2);
peakOrders = round(peakOrders,3)
ordertrack(map,mapOrder,mapRPM,mapTime,peakOrders)
orderWaveforms = orderwaveform(vib,fs,rpm,peakOrders);
helperPlotOrderWaveforms(t,orderWaveforms,vib)
mainRotorOrder = mainRotorEngineRatio;
tailRotorOrder = tailRotorEngineRatio;
ratioMain = peakOrders/mainRotorOrder
ratioTail = peakOrders/tailRotorOrder