I am having 2 figure with separated figure using tikzpicture
How can I make it into subfigure below:
\begin{figure}[htp!]
\begin{subfigure}{0.5\textwidth}
\centering
% include first image
\includegraphics[width=1\linewidth]{A.png}
\caption{A}
\label{A}
\end{subfigure}
\begin{subfigure}{.5\textwidth}
\centering
% include second image
\includegraphics[width=\linewidth]{B.png}
\caption{Combine A and B}
\end{subfigure}
\caption{B}
\label{B}
\end{figure}
My figure for tikzpicture are:

\begin{figure}[h!]
\centering
\begin{tikzpicture}[font=\sffamily,
declare function={f1(\x)=1.2*sin(2.5*deg(\x));
f2(\x)=0.6*(1.2*sin(2*deg(\x))+1*sin(4*deg(\x))+1.2*sin(6*deg(\x)));
}]
\begin{scope}[local bounding box=T]
\draw[latex-latex](0,3) node[above]{Amplitude} |- (8,0) ;
\draw plot[domain=0:7,variable=\x,samples=51,smooth] ({\x},{f1(\x)});
\end{scope}
\path foreach \X in {T} {(\X.east) node[below] {Time}};
\end{tikzpicture}
\caption{Simple pure tone (sine wave)}
\label{fig:Simple pure tone (sine wave)}
\end{figure}
\begin{figure}[h!]
\centering
\begin{tikzpicture}[font=\sffamily,
declare function={f1(\x)=1.2*sin(2.5*deg(\x));
f2(\x)=0.6*(1.2*sin(2*deg(\x))+1*sin(4*deg(\x))+1.2*sin(6*deg(\x)));
}]
\begin{scope}[yshift=-6cm,local bounding box=B]
\draw[latex-latex](0,3) node[above]{Amplitude} |- (10,0);
\draw plot[domain=0:9,variable=\x,samples=101,smooth] ({\x},{f2(\x)});
\end{scope}
%
\path foreach \X in {B} {(\X.east) node[below] {Time}};
\end{tikzpicture}
\caption{Complex waveform (sum of pure tone)}
\label{fig:Complex waveform (sum of pure tone)}
\end{figure}

