# Analyzing an undersampled recording from an antenna with matlab?

I'm trying to analyze the power spectral density of a signal recorded from a Ham radio antenna. The signal is about 30 seconds long, recorded at a 48 kHz sample rate. The frequency is center frequency of 8 kHz recording, with the receiver centered on 5.275 MHz. The signal I'm currently looking at is supposed to be around 5.260 MHz, however I'm getting inconsistent results with the matlab script below:

[FileName,PathName] = uigetfile('*.wav','Select the wav file');
PathName = strcat(PathName, FileName);  %Adds the filename to the end of the pathnames

[pxx,f] = pwelch(x,500,300,500,Fs);
plot(f,pxx)
xlabel('Hz'); ylabel('dB');


When I run this code with '5.260MHz.wav', it produces the following plot:

These frequency peaks all occur between 0-4 kHz, which is unexpected. Since 5.260e6 mod 48e3 = 28e3, I would expect the signal to be at 48e3 - 28e3 = 20e3, or 20 kHz.

I created my own signal and then undersampled it as follows:

% signal properties
f0 = 5.260e6;           % frequency 5.260 MHz
sf = 8e3;               % bandwidth 8 kHz

% sample properties
Fs = 24e6;              % sampling frequency 24 MHz
N = 10e6;               % number of samples

% generate random frequency modulated sinusoidal signal
fi = smooth(randn(N, 1), 11);
fi = fi / std(fi) * sf + f0;
x = cos(2 * pi * cumsum(fi) / Fs);
Fs = Fs / 500;
x = x(1 :500: end);

filename = 'test_5.260MHz.wav';
audiowrite(filename,x,Fs);


When I plot this signal with the above script, it looks as expected, with a peak at 20 KHz:

Finally, I used the following script from the mathworks site to create another signal, which also graphed as expected:

Fs = 1000;                    % Sampling frequency
T = 1/Fs;                     % Sample time
L = 1000;                     % Length of signal
t = (0:L-1)*T;                % Time vector
% Sum of a 50 Hz sinusoid and a 120 Hz sinusoid
x = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
y = x + 2*randn(size(t));     % Sinusoids plus noise

filename = 'test_50_120Hz.wav';
audiowrite(filename,y,Fs);


Because I'm getting consistent results with my generated files, I would like to believe that there is simply an error with the information concerning my antenna signal. However, I have several different antenna signals, and they are all graphing in the 0-4 kHz range, regardless of where the signal supposedly exists or the central frequency. This leads me to believe that I may be using the matlab code incorrectly, or that I may be misinterpreting how .wav files and radio signals work exactly.

Any input is appreciated. As I am still new to stackexchange, any suggestions on how to make the question clearer are also appreciated.

• Did you check the bandwidth of your sampling system? – John Jan 21 '14 at 0:02
• @John By sampling system, do you mean the ham radio antenna? It was "supposed" to have 8kHz of recording, but that makes it seem odd to me that the first graph is really only 4 kHz wide. However, I never actually use any information from the bandwidth in my pwelch script, except that it is less that 24 kHz which makes the signal reproduction possible. Do you think this discrepancy could be causing the problem? – Jake Jan 21 '14 at 1:07
• No I mean does the A/D converter have enough bandwidth at its input to reach your signal of interest at 5.26 MHz. – John Jan 21 '14 at 1:57
• I assume your ham radio tunes the center frequency (5.26 MHz) down to 0 Hz before you sample it. Are you really directly undersampling the 5.26 MHz with 48 kHz sampling? Because that won't work. – Jim Clay Jan 24 '14 at 16:39
• Jake, are you still looking for an answer? – user8144 Mar 6 '14 at 8:51