In this paper the problem of recognizing waveform and modulation is addressed in radar-communications coexistence and shared spectrum scenarios. We propose a deep learning method for waveform classification. A hierarchical recognition approach is employed. The received complex-valued signal is first classified to single carrier radar, communication or multicarrier waveforms. Fourier synchrosqueezing transformation (FSST) time-frequency representation is computed and used as an input to a convolutional neural network (CNN). For multicarrier signals, key waveform parameters including the cyclic prefix (CP) duration, number of subcarriers and subcarrier spacing are estimated. The modulation type used for subcarriers is recognized. Independent component analysis (ICA) is used to enforce independence of I- and Q-components, and consequently significantly improving the classification performance. Simulation results demonstrate the high classification performance of the proposed method even for orthogonal frequency division multiplexing (OFDM) signals with high-order quadrature amplitude modulation (QAM).