# How do I use ISBD and ISBH log data for frquency domain analysis in MATLAB?

Hello everyone,
I had collected some flight logs with high sampling rate enabled for the sensors. I have converted the .bin log file to a .mat file using mavlogdump.py.
Now I want to perform some frequency domain analysis on the accelerometer data in MATLAB, for this I understand that I have to extract data stored in ISBD by matching ISBD and ISBH but have no idea how to proceed with it. Can anyone help me regarding this?

I did a bit of that with the attitude data. Here was my code for that. There’s a much of extra stuff in there to make the plots look nicer.

log5 = Ardupilog('Edge540/SITL_doubletv3_02.BIN');
% log5.plot('ATT/Yaw')
sliced_log5 = log5.getSlice([919,920.3],'TimeS');
% sliced_log5.plot('ATT/Yaw')
% sliced_log5.plot('RCOU/C4')
log_struct5 = sliced_log5.getStruct();

t = log_struct5.ATT.TimeS;
% Y = nufft(log_struct5.ATT.Yaw,t,[],1);
n = length(t);
% f = 50*(0:n-1)/n;
% plot(f,abs(Y))

test = fft(log_struct5.ATT.Yaw-log_struct5.ATT.Yaw(1));
P2 = abs(test/n);
P1 = P2(1:n/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = 50*(0:n/2)/n;

figure('Name','plot-SITL-rudder-50Hz-FFT')
plot(f,P1)
xlabel('Frequency [Hz]')
ylabel('Magnitude [°]')
grid on

figure('Name','plot-SITL-rudder-50Hz-Time')
hold on
xlabel('Time [s]')
yyaxis left
plot(log_struct5.ATT.TimeS-log_struct5.ATT.TimeS(1),log_struct5.ATT.Yaw-log_struct5.ATT.Yaw(1),'-o','MarkerIndices',floor(linspace(1,length(log_struct5.ATT.Yaw),25)),'DisplayName','ATT.Yaw')
plot(log_struct5.ATT.TimeS-log_struct5.ATT.TimeS(1),log_struct5.ATT.Roll,'-^','MarkerIndices',floor(linspace(1,length(log_struct5.ATT.Roll),25)),'color',[0.8500 0.3250 0.0980],'DisplayName','ATT.Roll')
ylabel('Attitude [°] or PID output')
yyaxis right
plot(log_struct5.RCOU.TimeS-log_struct5.RCOU.TimeS(1),log_struct5.RCOU.C4,'-s','MarkerIndices',floor(linspace(1,length(log_struct5.RCOU.C4),25)),'color',[0.9290 0.6940 0.1250],'DisplayName','Rudder PWM')
ylabel('PWM [$\mu$s]','Interpreter','latex')
grid on

ax = gca;
ax.YAxis(1).Color = 'k';
ax.YAxis(2).Color = 'k';
legend('Location','northeast')


Thank you for replying. The thing is I am able to perform FFT on attitude rate plots sample at high frequency as the data is directly available in an easily understandable format but for raw accelerometer and gyro data sampled at high frequencies is stored in the ISBD and ISBH structures which isn’t in an easily understandable format. I see that you’re using ardupilog does it represent this data in an easily understandable format?