clc;
close all;
%% Load 10 real fine crackles here 
load RF1
load RF2
load RF3
load RF4
load RF5
load RF6
load RF7
load RF8
load RF9
load RF10
fs              = 44100;                                                      %% Sampling frequency
Signal_length   = 32768;                                                      %% Signal length
%% Make the length equal
RF1             = [zeros(1,1000),RF1,zeros(1,Signal_length-(1000+length(RF1)))];
RF2             = [zeros(1,3000),RF2,zeros(1,Signal_length-(3000+length(RF2)))];
RF3             = [zeros(1,7000),RF3,zeros(1,Signal_length-(7000+length(RF3)))];
RF4             = [zeros(1,12000),RF4,zeros(1,Signal_length-(12000+length(RF4)))];
RF5             = [zeros(1,14000),RF5,zeros(1,Signal_length-(14000+length(RF5)))];
RF6             = [zeros(1,17000),RF6,zeros(1,Signal_length-(17000+length(RF6)))];
RF7             = [zeros(1,20000),RF7,zeros(1,Signal_length-(20000+length(RF7)))];
RF8             = [zeros(1,23000),RF8,zeros(1,Signal_length-(23000+length(RF8)))];
RF9             = [zeros(1,27500),RF9,zeros(1,Signal_length-(27500+length(RF9)))];
RF10            = [zeros(1,30000),RF10,zeros(1,Signal_length-(30000+length(RF10)))];
Ten_real_fine_crackles      = RF1+RF2+RF3+RF4+RF5+RF6+RF7+RF8+RF9+RF10;
Ten_real_fine_crackles      = Ten_real_fine_crackles(1:end);
%% Plot
figure
plot(Ten_real_fine_crackles,'k');
xlabel('Number of samples','FontSize',12,'FontName','Times New Roman','fontweight','bold');
ylabel('Amplitude','FontSize',12,'FontName','Times New Roman','fontweight','bold');
%%
text(1150,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(1150,.45,'RF1','fontsize',8,'FontWeight','bold')
text(3150,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(3150,.45,'RF2','fontsize',8,'FontWeight','bold')
text(7150,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(7150,.45,'RF3','fontsize',8,'FontWeight','bold')
text(12150,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(12150,.45,'RF4','fontsize',8,'FontWeight','bold')
text(14150,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(14150,.45,'RF5','fontsize',8,'FontWeight','bold')
text(17150,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(17150,.45,'RF6','fontsize',8,'FontWeight','bold')
text(20150,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(20150,.45,'RF7','fontsize',8,'FontWeight','bold')
text(23150,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(23150,.45,'RF8','fontsize',8,'FontWeight','bold')
text(27650,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(27650,.45,'RF9','fontsize',8,'FontWeight','bold')
text(30150,.4,'\downarrow','fontsize',12,'FontWeight','bold')
text(30150,.45,'RF10','fontsize',8,'FontWeight','bold')
%%
set(gcf, 'Position',  [100, 300, 800, 300])
title('10 real fine crackles','FontSize',12,'FontName','Times New Roman','fontweight','bold');
ylim([-.5 .5]);
xlim([0 Signal_length]);
