I am building a morse code decoder in Python. I am using SciPy and Numpy for FFT, filter, etc. It is coming along ok, but the signal is noisy. I am extracting the dominant frequency from the FFT of the input signal (which is audio from a wav file), and sampling at a rate great enough to detect whether a signal is present at these intervals. Would I benefit from implementing a filter around this dominant frequency before processing the signal? If so, what sort of filter, how wide, etc? The dominant frequency is variable, but I determine it at each invocation programmatically (fft).
The bandwidth of the message content of a CW signal in Hz is roughly at least 4 times the WPM at which the dots and dashes of each Morse Code character are being keyed. The actual signal may take up a several multiples of that bandwidth, depending on the envelope shaping or the rise/fall time of the CW transmitter used to prevent key clicks. (Plus a few harmonics of a Morse Code dot's AM modulation envelope may be required for a typical radio operator to reliably copy dots by ear, requiring a bandwidth multiple corresponding to that harmonic number). So any audio filter bandwidth needs to be at least that wide to pass a Morse Code signal, either by measuring the WPM of the signal, or using some maximum WPM expected.
When I did this once I did use a bandpass filter around the estimated tone frequency. I used a fairly large passband. You can use your favorite type of bandpass filter. One thing to check is that if the transmission rate is very fast compared to the tone frequency there may not be that many cycles of the tone when transmitting a dot.