
filepath = 'D:\Audio_Solutions\IN_EAR\Recording_samples\20190110_Wind_Test';

[FrmDT, THD_DT_PwrOuter, THD_PwrDiffOuterInner, PwrDiffInOut, FrmRioLowBand, THDFrmRioLowBand, FrmPiLowBand, THDFrmPiLowBand, VADinout, FrmPoLowBand] =...
    textread([filepath '\inoutVAD_r166_new.txt'], '%d %d %d %d %d %d %d %d %d %d');

figure(1);
subplot(311);plot(FrmRioLowBand);hold on;plot(THDFrmRioLowBand,'r');title('VAD lowband ratio');grid on
subplot(312);plot(FrmPiLowBand);hold on;plot(THDFrmPiLowBand,'r');title('VAD lowband energy');grid on
subplot(313);plot(VADinout,'LineWidth',2);ylim([-0.1 1.1]);grid on;title('2mic VAD')

figure(21);clf;
plot(FrmPoLowBand);hold on;
plot(FrmPiLowBand,'r');hold on;
plot(FrmPoLowBand-FrmPiLowBand,'g');hold on;
plot(PwrDiffInOut,'k');grid on;hold on;
plot(THD_PwrDiffOuterInner, 'c');hold on;
% plot(3800*(ones(length(THD_PwrDiffOuterInner),1)), 'c');hold on;
plot(THD_DT_PwrOuter, 'm')
legend('Pout','Pin','Pdiff','PdiffAvg', 'THD PdiffAvg to detect Wind', 'THD DT Pwr Outer', 'location', 'EastOutside')


figure(3);plot(FrmDT);ylim([-0.1 1.1]);grid on;title('2mic DT')