I think that older issues of QST magazine published an article on DSP for Morse / CW decoding several years ago. You might want to try to find their archives.
Basically, you need a DSP code to determine if a tone is present at any given time, and an estimate of the start and stop of each tone. Then scale the duration of each tone and the interval between tones for the expected code speed and compare with the timing table for each Morse code letter to assess the probability of the presence of each or any letter.
In the simplest case, you may have a decision tree with a dash. With strong noise and attenuation plus a highly personalized fist / chronometer, you may need some sophisticated statistical and / or adaptive methods for matching sound patterns for decent results.
source share