Who can ignore a request like that?
Good evening tryipod,
What an interesting way to pose a problem!
There are so many ways to jam/obscure a signal, I took a guess that your signal was being masked by the addition of something else, and indeed it was... let me paste my solution script here and walk you through it:
Code C - [expand] |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| % Dejam.m 30 Apr 2012
% Load given data file
load('jamming.mat');
% Assume jamming accomplished by addition with fixed frequency tone(s)
% (Have a quick look at the spectrum and see what we see)
figure;
pwelch(signal, [],[],[], Fs);
% Ah ha! Two prominant spectral peaks are visible... together with some
% (lower level) features in the human speech range of frequencies.
% Create filters to notch out the tones...
% (I initially tried simple low-pass filtering, but it muddied the audio
% to the point of unintelligibility). The number of poles & bandwidths
% were simply educated guesses and by no means optimal.
filt1 = fdesign.notch('N,F0,BW', 10, 500, 100, Fs); % 500 Hz
filt2 = fdesign.notch('N,F0,BW', 10, 5000, 100, Fs); % 5 kHz
oneToneGone = filter(design(filt1), signal);
bothTonesGone = filter(design(filt2), oneToneGone);
% Check the spectrum again to make sure the filters did their job...
figure;
pwelch(bothTonesGone, [],[],[], Fs);
% Neat! Let's listen...
sound(bothTonesGone, Fs);
% "DSP is cool" eh? Yes, it is :) |
The pwelch() function provides a convenient front-end for spectral estimation tasks - here, I've invoked it with a minimum of arguments to quickly examine the overall form of the file's spectrum. The default parameters are quite useful, and clearly reveal the presence of two equal-amplitude pure tones (at 500 Hz and 5 kHz) in the data. Given their amplitudes were equal I assumed these were the jamming tones, and set out to remove them.
You *can* use fdatool for the filter design (selecting the appropriate filter shape in the 'response type' field at lower left), but here I've specified the filter parameters as arguments to fdesign.xxxxx(); After unsuccessfully low-pass filtering the signal (which certainly hammered the amplitudes of the jamming tones down, but rendered the audio uncomprehensible) I decided to just notch out the tones - and that worked a treat
The sound() function then plays the audio file through the PC's audio output... and there's your answer!
[The result obtained could certainly be improved substantially from this first pass though. Optimisation of the notch order and bandwidth might improve the recovered audio, and using a non-causal filter such as the filtfilt() function would eliminate the audible 'pop' at the start of the audio due to the filter's numerical "startup" overhead.]
Enjoy - it sounds like you've got a good DSP teacher