<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://fweb.wallawalla.edu/class-wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michael.vonpohle</id>
	<title>Class Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://fweb.wallawalla.edu/class-wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michael.vonpohle"/>
	<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php/Special:Contributions/Michael.vonpohle"/>
	<updated>2026-05-18T07:31:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10774</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10774"/>
		<updated>2013-05-18T06:22:23Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* PID Controller Problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear all&lt;br /&gt;
close all&lt;br /&gt;
clc&lt;br /&gt;
&lt;br /&gt;
fc = 100+rand(1)*3900                 % Carrier Frequency&lt;br /&gt;
%fc = 1500;&lt;br /&gt;
Fs = 10000;                  % Sampling frequency&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
%% Encode the message&lt;br /&gt;
&lt;br /&gt;
phase = rand(1)*2*pi;                 % Phase of the signal&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
&lt;br /&gt;
messageString = &#039;Hello World! The quick brown fox jumps over the lazy dog. ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789&#039;;&lt;br /&gt;
[message charTable] = make_bits(messageString);&lt;br /&gt;
&lt;br /&gt;
baseband = []; &lt;br /&gt;
m=1;&lt;br /&gt;
for k = 1:length(message)&lt;br /&gt;
    if(message(k)==0)&lt;br /&gt;
        baseband = [baseband, zero*m];&lt;br /&gt;
        m=-m;&lt;br /&gt;
    else&lt;br /&gt;
        baseband = [baseband, one*m];&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
t = 0:1/(Fs):length(baseband)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
v = baseband.*cos(2*pi*fc*t+phase);&lt;br /&gt;
&lt;br /&gt;
% Noise&lt;br /&gt;
v = v+randn(size(v))*10^(-10/20);&lt;br /&gt;
&lt;br /&gt;
wavwrite(v,Fs,&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
figure(1)&lt;br /&gt;
subplot(2,1,1)&lt;br /&gt;
plot(t,baseband)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,1,2)&lt;br /&gt;
plot(t,v)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband with Carrier&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
movegui(&#039;northwest&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Decode Message&lt;br /&gt;
&lt;br /&gt;
clear all&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
% [v,Fs] = wavread(&#039;PSK31_sample.wav&#039;);&lt;br /&gt;
% [v,Fs] = wavread(&#039;capture.wav&#039;);&lt;br /&gt;
[v,Fs] = wavread(&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
t = 0:1/(Fs):length(v)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
[sout charTable] = load_alpha();&lt;br /&gt;
&lt;br /&gt;
upperNoiseCutOff = .75;&lt;br /&gt;
lowerNoiseCutOff = 1-upperNoiseCutOff;&lt;br /&gt;
&lt;br /&gt;
% figure(1)&lt;br /&gt;
% plot(v)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Determine Carrier Frequency&lt;br /&gt;
&lt;br /&gt;
vFftShift = abs(fftshift(fft(v)));&lt;br /&gt;
&lt;br /&gt;
freq = linspace(0,length(v)-1,length(v))*(Fs/length(v));&lt;br /&gt;
freqShift = (freq - Fs/2);&lt;br /&gt;
&lt;br /&gt;
% remove noise components&lt;br /&gt;
noise = (vFftShift &amp;lt; lowerNoiseCutOff*max(vFftShift));&lt;br /&gt;
vFftShift(noise) = 0;&lt;br /&gt;
&lt;br /&gt;
% uses the center(mean) of the fft spike as the frequency&lt;br /&gt;
freqRange = find(vFftShift(length(vFftShift)/2:length(vFftShift)) &amp;gt; 0);&lt;br /&gt;
carrierFreq = freqShift(round(mean([max(freqRange),min(freqRange)]))+length(vFftShift)/2-1)&lt;br /&gt;
&lt;br /&gt;
figure(2)&lt;br /&gt;
plot(freqShift,vFftShift)&lt;br /&gt;
movegui(&#039;center&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Mix and Filter&lt;br /&gt;
&lt;br /&gt;
mix = v.*cos(2*pi*(carrierFreq)*t)&#039;;&lt;br /&gt;
% mix = v.*cos(2*pi*(fc)*t)&#039;;&lt;br /&gt;
&lt;br /&gt;
figure(4)&lt;br /&gt;
subplot(2,2,1)&lt;br /&gt;
plot(t,mix)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Signal Multiplied by Cosine&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,2,3)&lt;br /&gt;
mixFft = abs(fftshift(fft(mix)));&lt;br /&gt;
plot(freqShift,mixFft)&lt;br /&gt;
title(&#039;\fontsize{14}FFT of Multiplied Signal&#039;)&lt;br /&gt;
xlabel(&#039;Frequency (Hz)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
text(150,.8*max(mixFft),sprintf(&#039;Low Frequency\n&amp;lt;- Component&#039;))&lt;br /&gt;
text(300,.25*max(mixFft),sprintf(&#039;High Frequency\nComponent -&amp;gt;&#039;))&lt;br /&gt;
&lt;br /&gt;
[b,a] = butter(5,(75)/Fs);&lt;br /&gt;
mixFilter = filter(b,a,mix);&lt;br /&gt;
mixFilterFft = abs(fftshift(fft(mixFilter)));&lt;br /&gt;
subplot(2,2,2)&lt;br /&gt;
plot(t,mixFilter)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Multiplied Signal Filtered&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,2,4)&lt;br /&gt;
plot(freqShift,mixFilterFft)&lt;br /&gt;
title(&#039;\fontsize{14}FFT of Filtered Signal&#039;)&lt;br /&gt;
xlabel(&#039;Frequency (Hz)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
text(150,.8*max(mixFft),sprintf(&#039;Low Frequency\n&amp;lt;- Component&#039;))&lt;br /&gt;
movegui(&#039;west&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Sign Change Method&lt;br /&gt;
k = 1&lt;br /&gt;
for n = 1:length(v)-1&lt;br /&gt;
	if (sign(mixFilter(n+1)) ~= sign(mixFilter(n)))&lt;br /&gt;
		zeroLoc(k) = n;&lt;br /&gt;
		k = k+1;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
period = Fs/baud;&lt;br /&gt;
&lt;br /&gt;
bitstream = []&lt;br /&gt;
for n = 1:length(zeroLoc)-1&lt;br /&gt;
	periodDiff = zeroLoc(n+1)-zeroLoc(n);&lt;br /&gt;
	cross = round(periodDiff/period) - 1;&lt;br /&gt;
	if (cross == 0)&lt;br /&gt;
		bitstream = [bitstream 0];&lt;br /&gt;
	else if (cross &amp;gt; 0)&lt;br /&gt;
			bitstream = [bitstream ones(1,cross) 0];&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bitstream = [bitstream ones(1,10)]; %pad with ones for end of message&lt;br /&gt;
&lt;br /&gt;
sample = zeros(1,length(v));&lt;br /&gt;
sample(zeroLoc) = 1;&lt;br /&gt;
&lt;br /&gt;
figure(5)&lt;br /&gt;
plot(t,mixFilter,&#039;b&#039;)&lt;br /&gt;
hold on&lt;br /&gt;
plot(t,sample,&#039;k&#039;)&lt;br /&gt;
hold off&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Sign Change Sync Points&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
legend(&#039;Filtered Signal&#039;,&#039;Sync Points&#039;,&#039;location&#039;,&#039;best&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Sync_Points.png|600px]]&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Bitstream to Characters&lt;br /&gt;
&lt;br /&gt;
breakLoc = [];&lt;br /&gt;
k = 1;&lt;br /&gt;
for n = 1:length(bitstream)-2&lt;br /&gt;
	% Finds &#039;00&#039; bits indicating new character&lt;br /&gt;
	if(isequal(find(bitstream(n:n+1) == [0 0]),[1 2]))&lt;br /&gt;
		breakLoc(k) = n;&lt;br /&gt;
		k = k+1;&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
messageText = &#039;&#039;;&lt;br /&gt;
for n = 1:length(breakLoc)-1&lt;br /&gt;
	messageChunks = bitstream(breakLoc(n):breakLoc(n+1)-1);&lt;br /&gt;
	temp = mat2str(messageChunks);&lt;br /&gt;
	temp = strrep(temp,&#039;[&#039;,&#039;&#039;);&lt;br /&gt;
	temp = strrep(temp,&#039;0 0 &#039;,&#039;&#039;);&lt;br /&gt;
	temp = strrep(temp,&#039;]&#039;,&#039;&#039;);&lt;br /&gt;
	if (((breakLoc(n+1) - breakLoc(n)) &amp;lt;= 12) &amp;amp;&amp;amp; (~isequal(temp,&#039;0&#039;)) &amp;amp;&amp;amp;(bin2dec(fliplr(temp)) &amp;lt;= length(charTable)))&lt;br /&gt;
		messageText = [messageText charTable(bin2dec(fliplr(temp)))];&lt;br /&gt;
	end;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
messageText&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A simple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10704</id>
		<title>User:Michael.vonpohle</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10704"/>
		<updated>2013-04-16T22:57:50Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General Information ==&lt;br /&gt;
I&#039;m an electrical engineering major and have attended Walla Walla University since 2009. I plan to graduate in 2013. This page contains a summary of my contributions to the wiki.&lt;br /&gt;
== Projects/Pages ==&lt;br /&gt;
[[PSK31 Demodulation (Kurt &amp;amp; Michael)]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=Hildebrand,_Kurt&amp;diff=10703</id>
		<title>Hildebrand, Kurt</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=Hildebrand,_Kurt&amp;diff=10703"/>
		<updated>2013-04-16T22:57:01Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Contact Information ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Phone:&#039;&#039;&#039; (909)528-3558&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Prefered E-mail:&#039;&#039;&#039; kurthildebrand@gmail.com&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;School E-mail:&#039;&#039;&#039; kurt.hildebrand@wallawalla.edu&lt;br /&gt;
&lt;br /&gt;
== PSK 31 Demodulation ==&lt;br /&gt;
&lt;br /&gt;
Fall, 2012&lt;br /&gt;
*Partner [[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
[[PSK31 Demodulation (Kurt &amp;amp; Michael)]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10658</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10658"/>
		<updated>2012-12-14T10:33:31Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear all&lt;br /&gt;
close all&lt;br /&gt;
clc&lt;br /&gt;
&lt;br /&gt;
fc = 100+rand(1)*3900                 % Carrier Frequency&lt;br /&gt;
%fc = 1500;&lt;br /&gt;
Fs = 10000;                  % Sampling frequency&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
%% Encode the message&lt;br /&gt;
&lt;br /&gt;
phase = rand(1)*2*pi;                 % Phase of the signal&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
&lt;br /&gt;
messageString = &#039;Hello World! The quick brown fox jumps over the lazy dog. ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789&#039;;&lt;br /&gt;
[message charTable] = make_bits(messageString);&lt;br /&gt;
&lt;br /&gt;
baseband = []; &lt;br /&gt;
m=1;&lt;br /&gt;
for k = 1:length(message)&lt;br /&gt;
    if(message(k)==0)&lt;br /&gt;
        baseband = [baseband, zero*m];&lt;br /&gt;
        m=-m;&lt;br /&gt;
    else&lt;br /&gt;
        baseband = [baseband, one*m];&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
t = 0:1/(Fs):length(baseband)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
v = baseband.*cos(2*pi*fc*t+phase);&lt;br /&gt;
&lt;br /&gt;
% Noise&lt;br /&gt;
v = v+randn(size(v))*10^(-10/20);&lt;br /&gt;
&lt;br /&gt;
wavwrite(v,Fs,&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
figure(1)&lt;br /&gt;
subplot(2,1,1)&lt;br /&gt;
plot(t,baseband)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,1,2)&lt;br /&gt;
plot(t,v)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband with Carrier&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
movegui(&#039;northwest&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Decode Message&lt;br /&gt;
&lt;br /&gt;
clear all&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
% [v,Fs] = wavread(&#039;PSK31_sample.wav&#039;);&lt;br /&gt;
% [v,Fs] = wavread(&#039;capture.wav&#039;);&lt;br /&gt;
[v,Fs] = wavread(&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
t = 0:1/(Fs):length(v)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
[sout charTable] = load_alpha();&lt;br /&gt;
&lt;br /&gt;
upperNoiseCutOff = .75;&lt;br /&gt;
lowerNoiseCutOff = 1-upperNoiseCutOff;&lt;br /&gt;
&lt;br /&gt;
% figure(1)&lt;br /&gt;
% plot(v)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Determine Carrier Frequency&lt;br /&gt;
&lt;br /&gt;
vFftShift = abs(fftshift(fft(v)));&lt;br /&gt;
&lt;br /&gt;
freq = linspace(0,length(v)-1,length(v))*(Fs/length(v));&lt;br /&gt;
freqShift = (freq - Fs/2);&lt;br /&gt;
&lt;br /&gt;
% remove noise components&lt;br /&gt;
noise = (vFftShift &amp;lt; lowerNoiseCutOff*max(vFftShift));&lt;br /&gt;
vFftShift(noise) = 0;&lt;br /&gt;
&lt;br /&gt;
% uses the center(mean) of the fft spike as the frequency&lt;br /&gt;
freqRange = find(vFftShift(length(vFftShift)/2:length(vFftShift)) &amp;gt; 0);&lt;br /&gt;
carrierFreq = freqShift(round(mean([max(freqRange),min(freqRange)]))+length(vFftShift)/2-1)&lt;br /&gt;
&lt;br /&gt;
figure(2)&lt;br /&gt;
plot(freqShift,vFftShift)&lt;br /&gt;
movegui(&#039;center&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Mix and Filter&lt;br /&gt;
&lt;br /&gt;
mix = v.*cos(2*pi*(carrierFreq)*t)&#039;;&lt;br /&gt;
% mix = v.*cos(2*pi*(fc)*t)&#039;;&lt;br /&gt;
&lt;br /&gt;
figure(4)&lt;br /&gt;
subplot(2,2,1)&lt;br /&gt;
plot(t,mix)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Signal Multiplied by Cosine&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,2,3)&lt;br /&gt;
mixFft = abs(fftshift(fft(mix)));&lt;br /&gt;
plot(freqShift,mixFft)&lt;br /&gt;
title(&#039;\fontsize{14}FFT of Multiplied Signal&#039;)&lt;br /&gt;
xlabel(&#039;Frequency (Hz)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
text(150,.8*max(mixFft),sprintf(&#039;Low Frequency\n&amp;lt;- Component&#039;))&lt;br /&gt;
text(300,.25*max(mixFft),sprintf(&#039;High Frequency\nComponent -&amp;gt;&#039;))&lt;br /&gt;
&lt;br /&gt;
[b,a] = butter(5,(75)/Fs);&lt;br /&gt;
mixFilter = filter(b,a,mix);&lt;br /&gt;
mixFilterFft = abs(fftshift(fft(mixFilter)));&lt;br /&gt;
subplot(2,2,2)&lt;br /&gt;
plot(t,mixFilter)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Multiplied Signal Filtered&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,2,4)&lt;br /&gt;
plot(freqShift,mixFilterFft)&lt;br /&gt;
title(&#039;\fontsize{14}FFT of Filtered Signal&#039;)&lt;br /&gt;
xlabel(&#039;Frequency (Hz)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
text(150,.8*max(mixFft),sprintf(&#039;Low Frequency\n&amp;lt;- Component&#039;))&lt;br /&gt;
movegui(&#039;west&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Sign Change Method&lt;br /&gt;
k = 1&lt;br /&gt;
for n = 1:length(v)-1&lt;br /&gt;
	if (sign(mixFilter(n+1)) ~= sign(mixFilter(n)))&lt;br /&gt;
		zeroLoc(k) = n;&lt;br /&gt;
		k = k+1;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
period = Fs/baud;&lt;br /&gt;
&lt;br /&gt;
bitstream = []&lt;br /&gt;
for n = 1:length(zeroLoc)-1&lt;br /&gt;
	periodDiff = zeroLoc(n+1)-zeroLoc(n);&lt;br /&gt;
	cross = round(periodDiff/period) - 1;&lt;br /&gt;
	if (cross == 0)&lt;br /&gt;
		bitstream = [bitstream 0];&lt;br /&gt;
	else if (cross &amp;gt; 0)&lt;br /&gt;
			bitstream = [bitstream ones(1,cross) 0];&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bitstream = [bitstream ones(1,10)]; %pad with ones for end of message&lt;br /&gt;
&lt;br /&gt;
sample = zeros(1,length(v));&lt;br /&gt;
sample(zeroLoc) = 1;&lt;br /&gt;
&lt;br /&gt;
figure(5)&lt;br /&gt;
plot(t,mixFilter,&#039;b&#039;)&lt;br /&gt;
hold on&lt;br /&gt;
plot(t,sample,&#039;k&#039;)&lt;br /&gt;
hold off&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Sign Change Sync Points&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
legend(&#039;Filtered Signal&#039;,&#039;Sync Points&#039;,&#039;location&#039;,&#039;best&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Sync_Points.png|600px]]&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Bitstream to Characters&lt;br /&gt;
&lt;br /&gt;
breakLoc = [];&lt;br /&gt;
k = 1;&lt;br /&gt;
for n = 1:length(bitstream)-2&lt;br /&gt;
	% Finds &#039;00&#039; bits indicating new character&lt;br /&gt;
	if(isequal(find(bitstream(n:n+1) == [0 0]),[1 2]))&lt;br /&gt;
		breakLoc(k) = n;&lt;br /&gt;
		k = k+1;&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
messageText = &#039;&#039;;&lt;br /&gt;
for n = 1:length(breakLoc)-1&lt;br /&gt;
	messageChunks = bitstream(breakLoc(n):breakLoc(n+1)-1);&lt;br /&gt;
	temp = mat2str(messageChunks);&lt;br /&gt;
	temp = strrep(temp,&#039;[&#039;,&#039;&#039;);&lt;br /&gt;
	temp = strrep(temp,&#039;0 0 &#039;,&#039;&#039;);&lt;br /&gt;
	temp = strrep(temp,&#039;]&#039;,&#039;&#039;);&lt;br /&gt;
	if (((breakLoc(n+1) - breakLoc(n)) &amp;lt;= 12) &amp;amp;&amp;amp; (~isequal(temp,&#039;0&#039;)) &amp;amp;&amp;amp;(bin2dec(fliplr(temp)) &amp;lt;= length(charTable)))&lt;br /&gt;
		messageText = [messageText charTable(bin2dec(fliplr(temp)))];&lt;br /&gt;
	end;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
messageText&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10657</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10657"/>
		<updated>2012-12-14T10:32:42Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear all&lt;br /&gt;
close all&lt;br /&gt;
clc&lt;br /&gt;
&lt;br /&gt;
fc = 100+rand(1)*3900                 % Carrier Frequency&lt;br /&gt;
%fc = 1500;&lt;br /&gt;
Fs = 10000;                  % Sampling frequency&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
%% Encode the message&lt;br /&gt;
&lt;br /&gt;
phase = rand(1)*2*pi;                 % Phase of the signal&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
&lt;br /&gt;
messageString = &#039;Hello World! The quick brown fox jumps over the lazy dog. ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789&#039;;&lt;br /&gt;
[message charTable] = make_bits(messageString);&lt;br /&gt;
&lt;br /&gt;
baseband = []; &lt;br /&gt;
m=1;&lt;br /&gt;
for k = 1:length(message)&lt;br /&gt;
    if(message(k)==0)&lt;br /&gt;
        baseband = [baseband, zero*m];&lt;br /&gt;
        m=-m;&lt;br /&gt;
    else&lt;br /&gt;
        baseband = [baseband, one*m];&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
t = 0:1/(Fs):length(baseband)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
v = baseband.*cos(2*pi*fc*t+phase);&lt;br /&gt;
&lt;br /&gt;
% Noise&lt;br /&gt;
v = v+randn(size(v))*10^(-10/20);&lt;br /&gt;
&lt;br /&gt;
wavwrite(v,Fs,&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
figure(1)&lt;br /&gt;
subplot(2,1,1)&lt;br /&gt;
plot(t,baseband)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,1,2)&lt;br /&gt;
plot(t,v)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband with Carrier&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
movegui(&#039;northwest&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Decode Message&lt;br /&gt;
&lt;br /&gt;
clear all&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
% [v,Fs] = wavread(&#039;PSK31_sample.wav&#039;);&lt;br /&gt;
% [v,Fs] = wavread(&#039;capture.wav&#039;);&lt;br /&gt;
[v,Fs] = wavread(&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
t = 0:1/(Fs):length(v)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
[sout charTable] = load_alpha();&lt;br /&gt;
&lt;br /&gt;
upperNoiseCutOff = .75;&lt;br /&gt;
lowerNoiseCutOff = 1-upperNoiseCutOff;&lt;br /&gt;
&lt;br /&gt;
% figure(1)&lt;br /&gt;
% plot(v)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Determine Carrier Frequency&lt;br /&gt;
&lt;br /&gt;
vFftShift = abs(fftshift(fft(v)));&lt;br /&gt;
&lt;br /&gt;
freq = linspace(0,length(v)-1,length(v))*(Fs/length(v));&lt;br /&gt;
freqShift = (freq - Fs/2);&lt;br /&gt;
&lt;br /&gt;
% remove noise components&lt;br /&gt;
noise = (vFftShift &amp;lt; lowerNoiseCutOff*max(vFftShift));&lt;br /&gt;
vFftShift(noise) = 0;&lt;br /&gt;
&lt;br /&gt;
% uses the center(mean) of the fft spike as the frequency&lt;br /&gt;
freqRange = find(vFftShift(length(vFftShift)/2:length(vFftShift)) &amp;gt; 0);&lt;br /&gt;
carrierFreq = freqShift(round(mean([max(freqRange),min(freqRange)]))+length(vFftShift)/2-1)&lt;br /&gt;
&lt;br /&gt;
figure(2)&lt;br /&gt;
plot(freqShift,vFftShift)&lt;br /&gt;
movegui(&#039;center&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
%% Mix and Filter&lt;br /&gt;
&lt;br /&gt;
mix = v.*cos(2*pi*(carrierFreq)*t)&#039;;&lt;br /&gt;
% mix = v.*cos(2*pi*(fc)*t)&#039;;&lt;br /&gt;
&lt;br /&gt;
figure(4)&lt;br /&gt;
subplot(2,2,1)&lt;br /&gt;
plot(t,mix)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Signal Multiplied by Cosine&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,2,3)&lt;br /&gt;
mixFft = abs(fftshift(fft(mix)));&lt;br /&gt;
plot(freqShift,mixFft)&lt;br /&gt;
title(&#039;\fontsize{14}FFT of Multiplied Signal&#039;)&lt;br /&gt;
xlabel(&#039;Frequency (Hz)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
text(150,.8*max(mixFft),sprintf(&#039;Low Frequency\n&amp;lt;- Component&#039;))&lt;br /&gt;
text(300,.25*max(mixFft),sprintf(&#039;High Frequency\nComponent -&amp;gt;&#039;))&lt;br /&gt;
&lt;br /&gt;
[b,a] = butter(5,(75)/Fs);&lt;br /&gt;
mixFilter = filter(b,a,mix);&lt;br /&gt;
mixFilterFft = abs(fftshift(fft(mixFilter)));&lt;br /&gt;
subplot(2,2,2)&lt;br /&gt;
plot(t,mixFilter)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Multiplied Signal Filtered&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,2,4)&lt;br /&gt;
plot(freqShift,mixFilterFft)&lt;br /&gt;
title(&#039;\fontsize{14}FFT of Filtered Signal&#039;)&lt;br /&gt;
xlabel(&#039;Frequency (Hz)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
text(150,.8*max(mixFft),sprintf(&#039;Low Frequency\n&amp;lt;- Component&#039;))&lt;br /&gt;
movegui(&#039;west&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Sign Change Method&lt;br /&gt;
k = 1&lt;br /&gt;
for n = 1:length(v)-1&lt;br /&gt;
	if (sign(mixFilter(n+1)) ~= sign(mixFilter(n)))&lt;br /&gt;
		zeroLoc(k) = n;&lt;br /&gt;
		k = k+1;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
period = Fs/baud;&lt;br /&gt;
&lt;br /&gt;
bitstream = []&lt;br /&gt;
for n = 1:length(zeroLoc)-1&lt;br /&gt;
	periodDiff = zeroLoc(n+1)-zeroLoc(n);&lt;br /&gt;
	cross = round(periodDiff/period) - 1;&lt;br /&gt;
	if (cross == 0)&lt;br /&gt;
		bitstream = [bitstream 0];&lt;br /&gt;
	else if (cross &amp;gt; 0)&lt;br /&gt;
			bitstream = [bitstream ones(1,cross) 0];&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bitstream = [bitstream ones(1,10)]; %pad with ones for end of message&lt;br /&gt;
&lt;br /&gt;
sample = zeros(1,length(v));&lt;br /&gt;
sample(zeroLoc) = 1;&lt;br /&gt;
&lt;br /&gt;
figure(5)&lt;br /&gt;
plot(t,mixFilter,&#039;b&#039;)&lt;br /&gt;
hold on&lt;br /&gt;
plot(t,sample,&#039;k&#039;)&lt;br /&gt;
hold off&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Sign Change Sync Points&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
legend(&#039;Filtered Signal&#039;,&#039;Sync Points&#039;,&#039;location&#039;,&#039;best&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Sync_Points.png|600px]]&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Bitstream to Characters&lt;br /&gt;
&lt;br /&gt;
breakLoc = [];&lt;br /&gt;
k = 1;&lt;br /&gt;
for n = 1:length(bitstream)-2&lt;br /&gt;
	% Finds &#039;00&#039; bits indicating new character&lt;br /&gt;
	if(isequal(find(bitstream(n:n+1) == [0 0]),[1 2]))&lt;br /&gt;
		breakLoc(k) = n;&lt;br /&gt;
		k = k+1;&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
messageText = &#039;&#039;;&lt;br /&gt;
for n = 1:length(breakLoc)-1&lt;br /&gt;
	messageChunks = bitstream(breakLoc(n):breakLoc(n+1)-1);&lt;br /&gt;
	temp = mat2str(messageChunks);&lt;br /&gt;
	temp = strrep(temp,&#039;[&#039;,&#039;&#039;);&lt;br /&gt;
	temp = strrep(temp,&#039;0 0 &#039;,&#039;&#039;);&lt;br /&gt;
	temp = strrep(temp,&#039;]&#039;,&#039;&#039;);&lt;br /&gt;
	if (((breakLoc(n+1) - breakLoc(n)) &amp;lt;= 12) &amp;amp;&amp;amp; (~isequal(temp,&#039;0&#039;)) &amp;amp;&amp;amp;(bin2dec(fliplr(temp)) &amp;lt;= length(charTable)))&lt;br /&gt;
		messageText = [messageText charTable(bin2dec(fliplr(temp)))];&lt;br /&gt;
	end;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
messageText&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10656</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10656"/>
		<updated>2012-12-14T10:25:37Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear all&lt;br /&gt;
close all&lt;br /&gt;
clc&lt;br /&gt;
&lt;br /&gt;
fc = 100+rand(1)*3900                 % Carrier Frequency&lt;br /&gt;
%fc = 1500;&lt;br /&gt;
Fs = 10000;                  % Sampling frequency&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
%% Encode the message&lt;br /&gt;
&lt;br /&gt;
phase = rand(1)*2*pi;                 % Phase of the signal&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
&lt;br /&gt;
messageString = &#039;Hello World! The quick brown fox jumps over the lazy dog. ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789&#039;;&lt;br /&gt;
[message charTable] = make_bits(messageString);&lt;br /&gt;
&lt;br /&gt;
baseband = []; &lt;br /&gt;
m=1;&lt;br /&gt;
for k = 1:length(message)&lt;br /&gt;
    if(message(k)==0)&lt;br /&gt;
        baseband = [baseband, zero*m];&lt;br /&gt;
        m=-m;&lt;br /&gt;
    else&lt;br /&gt;
        baseband = [baseband, one*m];&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
t = 0:1/(Fs):length(baseband)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
v = baseband.*cos(2*pi*fc*t+phase);&lt;br /&gt;
&lt;br /&gt;
% Noise&lt;br /&gt;
v = v+randn(size(v))*10^(-10/20);&lt;br /&gt;
&lt;br /&gt;
wavwrite(v,Fs,&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
figure(1)&lt;br /&gt;
subplot(2,1,1)&lt;br /&gt;
plot(t,baseband)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,1,2)&lt;br /&gt;
plot(t,v)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband with Carrier&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
movegui(&#039;northwest&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Decode Message&lt;br /&gt;
&lt;br /&gt;
clear all&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
% [v,Fs] = wavread(&#039;PSK31_sample.wav&#039;);&lt;br /&gt;
% [v,Fs] = wavread(&#039;capture.wav&#039;);&lt;br /&gt;
[v,Fs] = wavread(&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
t = 0:1/(Fs):length(v)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
[sout charTable] = load_alpha();&lt;br /&gt;
&lt;br /&gt;
upperNoiseCutOff = .75;&lt;br /&gt;
lowerNoiseCutOff = 1-upperNoiseCutOff;&lt;br /&gt;
&lt;br /&gt;
% figure(1)&lt;br /&gt;
% plot(v)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10655</id>
		<title>User:Michael.vonpohle</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10655"/>
		<updated>2012-12-14T05:48:17Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General Information ==&lt;br /&gt;
I&#039;m an Electrical Engineering Major and have attended Walla Walla since 2009. I plan to graduate in 2013. This page contains a summary of my contributions to the wiki.&lt;br /&gt;
== Projects/Pages ==&lt;br /&gt;
[[PSK31 Demodulation (Kurt &amp;amp; Michael)]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10654</id>
		<title>User:Michael.vonpohle</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10654"/>
		<updated>2012-12-14T05:48:00Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* General Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General Information ==&lt;br /&gt;
I&#039;m an Electrical Engineering Major and have attended Walla Walla since 2009. I plan to graduate in 2013. This page contains a summary of my contributions to the wiki.&lt;br /&gt;
&lt;br /&gt;
== Projects/Pages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[PSK31 Demodulation (Kurt &amp;amp; Michael)]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=Signals_and_Systems&amp;diff=10653</id>
		<title>Signals and Systems</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=Signals_and_Systems&amp;diff=10653"/>
		<updated>2012-12-14T05:47:46Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* 2012-2013 Contributors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topics ==&lt;br /&gt;
[[Fourier series - by Ray Betz|Overview of Signals and Systems]]&lt;br /&gt;
&lt;br /&gt;
===Individual Subjects===&lt;br /&gt;
*[[Linear Time Invariant System|Linear Time Invariant Systems]]&lt;br /&gt;
**[[The Game|&amp;quot;The Game&amp;quot;]]&lt;br /&gt;
*[[Orthogonal functions|Orthogonal Functions]]&lt;br /&gt;
*[[Energy in a signal|Finding the Energy in a Signal]]&lt;br /&gt;
**[[Rayleigh&#039;s Theorem]]&lt;br /&gt;
*[[Fourier series|Fourier Series]]&lt;br /&gt;
*[[Fourier transform|Fourier Transforms]]&lt;br /&gt;
**[[Discrete Fourier transform]]&lt;br /&gt;
*[[Sampling]]&lt;br /&gt;
*[[FIR Filter Example]]&lt;br /&gt;
*[[Relationship between e, sin and cos]]&lt;br /&gt;
&lt;br /&gt;
== Some Useful Links to Suppliment or Substitute for a Textbook ==&lt;br /&gt;
===Books on Signal Processing===&lt;br /&gt;
*[https://ccrma.stanford.edu/~jos/sasp/sasp.html Spectral Audio Signal Processing, by Julius O. Smith III]&lt;br /&gt;
*[http://www.dspguide.com/ The Scientist and Engineer&#039;s Guide to Digital Signal Processing by Steven W. Smith, Ph.D.]  The professor likes this one.&lt;br /&gt;
*[http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-003-signals-and-systems-spring-2010/readings/ Discrete Time Signals &amp;amp; Systems]&lt;br /&gt;
&lt;br /&gt;
===Fourier Series===&lt;br /&gt;
*[http://www.intmath.com/Fourier-series/Fourier-intro.php Interactive Mathematics (like a textbook with some examples)]&lt;br /&gt;
*[http://mathworld.wolfram.com/FourierSeries.html Mathworld]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Fourier_series Wikipedia]&lt;br /&gt;
*[http://web.mit.edu/2.14/www/Handouts/FreqDom.pdf MIT handout on Fourier Series, Fourier Transform, and Laplace Transform]&lt;br /&gt;
*[http://www.maths.mq.edu.au/~bon/Fourier%20Theory.pdf Fourier Theory B..M..N.. Clarke]&lt;br /&gt;
&lt;br /&gt;
===Dirac Delta Function and Convolution===&lt;br /&gt;
*[http://web.mit.edu/2.14/www/Handouts/Convolution.pdf MIT handout on Dirac Delta Function and Convolution]&lt;br /&gt;
&lt;br /&gt;
===Multi-rate Filtering===&lt;br /&gt;
&lt;br /&gt;
[http://www.google.com/url?url=http://www.mds.com/tech/filter/multirate_article.pdf&amp;amp;rct=j&amp;amp;sa=U&amp;amp;ei=pD_UTJqtKY6ksQPbzPWMCw&amp;amp;ved=0CBUQFjAA&amp;amp;q=Purcell+Multirate+Filters&amp;amp;usg=AFQjCNFsHM7ROpUdrQ6py9ZH_RhQ_BeigA Multirate Filters Introduction]&lt;br /&gt;
&lt;br /&gt;
[http://www.ws.binghamton.edu/fowler/fowler%20personal%20page/EE521_files/IV-05%20Polyphase%20FIlters_2007.pdf Slides from a Presentation on Polyphase Decimation and Interpolation by Mark Fowler]&lt;br /&gt;
&lt;br /&gt;
===FIR Filters===&lt;br /&gt;
&lt;br /&gt;
[http://www.dspguru.com/dsp/faqs/fir This is a very easy-to-understand summary of FIR basics, properties, design, and implementation]&lt;br /&gt;
&lt;br /&gt;
[http://www.dspguru.com/dsp/faqs/multirate/decimation Another easy-to-understand article about decimation]&lt;br /&gt;
&lt;br /&gt;
[http://www.dspguru.com/dsp/faqs/multirate/interpolation Another easy-to-understand article about interpolation]&lt;br /&gt;
&lt;br /&gt;
===Adaptive FIR Filters===&lt;br /&gt;
[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.42.6386&amp;amp;rep=rep1&amp;amp;type=pdf Introduction to Adaptive Filters, Simon Haykin]&lt;br /&gt;
&lt;br /&gt;
[http://saba.kntu.ac.ir/eecd/taghirad/E%20books/TOC/Adaptive%20Filters.pdf Simon Haykin&#039;s book chapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.latticesemi.com/documents/doc22982x20.pdf?jsessionid=f0308ccf0f735471e49a6054323c5c177969 Adaptive LMS in an FPGA]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Adaptive Filters In the Frequency Domain]]&lt;br /&gt;
&lt;br /&gt;
====Constant Modulus Algorythm====&lt;br /&gt;
[http://ens.ewi.tudelft.nl/Education/courses/et4147/sheets/cma_leus.pdf Using the CMA on antenna arrays]&lt;br /&gt;
&lt;br /&gt;
===Course Pages===&lt;br /&gt;
[[2005-2006 Assignments]]&lt;br /&gt;
&lt;br /&gt;
[[2006-2007 Assignments]]&lt;br /&gt;
&lt;br /&gt;
[[2008-2009 Assignments]]&lt;br /&gt;
&lt;br /&gt;
[[2009-2010 Assignments]]&lt;br /&gt;
&lt;br /&gt;
[http://people.wallawalla.edu/~Rob.Frohne/ClassNotes/engr455index.htm Class notes for Signals &amp;amp; Systems]&lt;br /&gt;
&lt;br /&gt;
==Articles==&lt;br /&gt;
&lt;br /&gt;
===Octave Tutorials===&lt;br /&gt;
[[Installing Octave on a Mac]] (Chris Lau)&lt;br /&gt;
&lt;br /&gt;
[[Octave and Scilab on a Mac]] (Ben Henry)&lt;br /&gt;
&lt;br /&gt;
[[ASN2 - Octave Tutorial]] (Jodi S. Hodge)&lt;br /&gt;
&lt;br /&gt;
[[A u(t) function example]]&lt;br /&gt;
&lt;br /&gt;
[[FIR Filter Example Code for Octave]]&lt;br /&gt;
&lt;br /&gt;
[[Leakage Example Octave Script]]&lt;br /&gt;
&lt;br /&gt;
[[Interpolation using the DFT Example Script]]&lt;br /&gt;
&lt;br /&gt;
[[Tuner Upper Removal Demonstration]]&lt;br /&gt;
&lt;br /&gt;
[[Airplane Noise Removal Demonstration]]&lt;br /&gt;
&lt;br /&gt;
===Final Project (2011)===&lt;br /&gt;
[[Matlab/Octave deMorse.m]]&lt;br /&gt;
&lt;br /&gt;
[[morse.m  This is the one from mathworks]]&lt;br /&gt;
&lt;br /&gt;
===[[Table of Fourier Transform Properties]]===&lt;br /&gt;
&lt;br /&gt;
==Homework Assignments==&lt;br /&gt;
Please put your name next to the assignment, linking it to your submission&lt;br /&gt;
* HW #1 - Make a personal page on this wiki ([[Christopher Garrison Lau I|Chris Lau]])([[Jodi S. Hodge]])([[user:chris.wills|Chris Wills]])[[Shepherd,Victor|(Victor Shepherd)]]&lt;br /&gt;
* HW #2 - Write a tutorial about installing and/or using Octave ([[Installing Octave on a Mac|Chris Lau]])([[Jodi S. Hodge]])([[Octave|Victor Shepherd]])&lt;br /&gt;
* HW #3 - Show graphically that &amp;lt;math&amp;gt; \int_{-\infty}^{\infty} e^{j2\pi f(t-u)}\, df = \delta (t-u)&amp;lt;/math&amp;gt; ([[HW 3|Chris Lau]])([[Jodi S. Hodge]])([[user:chris.wills/HW3|Chris Wills]])([[Hw3|Victor Shepherd)]]&lt;br /&gt;
&lt;br /&gt;
* HW #4 - Given a linear time-invariant system where &amp;lt;math&amp;gt;\ u(t) &amp;lt;/math&amp;gt; produces an output &amp;lt;math&amp;gt;\ w(t) &amp;lt;/math&amp;gt;, find the output due to any function &amp;lt;math&amp;gt;\ x(t) &amp;lt;/math&amp;gt; ([[HW 4|Chris Lau]])&lt;br /&gt;
* HW #5: ([[HW 5|Chris Lau]])&lt;br /&gt;
** Part 1 -  Find &amp;lt;math&amp;gt; \mathcal{F}[e^{- \sigma t} x(t)u(t)] &amp;lt;/math&amp;gt; and relate it to the Laplace Transform. Derive the Inverse Laplace Transform of this from the inverse Fourier Transform.&lt;br /&gt;
** Part 2 - [[Image:20101006KeyDSCN3161.jpg|thumb|300px|center]]&lt;br /&gt;
&lt;br /&gt;
* HW #6 - Pick a property of the Fourier Transform &amp;amp; present it on the Wiki. Make a table with all your properties. Interpret your property. ([[HW 6|Ben Henry]])([[Table of Fourier Transform Properties|Chris Lau]])([[Table of Fourier Transform Properties|Victor Shepherd]])&lt;br /&gt;
* HW #7 - Finish the practice tests&lt;br /&gt;
* HW #8 - Make a page about interpolating FIR filters. Note how many multiply/add operations.([[Jodi S. Hodge]])([[Interpolating FIR filters|Chris Lau]])([[Hw8|Victor Shepherd]])&lt;br /&gt;
* HW #9 - Add to #8 writeup how to do a decimating filter and figure out how many multiply &amp;amp; adds are needed for a n/2 decimating low pass filter.([[Jodi S. Hodge]])([[Decimating FIR filters|Chris Lau]])([[Hw9|Victor Shepherd)]]&lt;br /&gt;
* HW #10 - Use Octave (or Mathlab or Silab) to plot the frequency response of low pass filters with cut off frequencies of 1/32T, 1/8T, and 1/4T and compare how many coeffficients are needed with an eye to answer the question &amp;quot;Is it less calculation to decimate and then filter, or better to put the filter in the pre-decimation filter?&amp;quot; ([[Jodi S. Hodge]])([[Hw10|Victor Shepherd)]]&lt;br /&gt;
* HW #11 - Is our method the same as Mark Fowler&#039;s? See &lt;br /&gt;
[http://www.ws.binghamton.edu/fowler/fowler%20personal%20page/EE521_files/IV-05%20Polyphase%20FIlters_2007.pdf Wiki]. Same # multiply and adds? See Notes 11/3/10. ([[Jodi S. Hodge]])([[Hw11|Victor Shepherd)]]&lt;br /&gt;
* HW #12 - Experiment with a variety of signals having a 3Khz bandwidth to determine the resolution you can get when doing a cross correlation &amp;lt;math&amp;gt; \ r(m) =&lt;br /&gt;
&lt;br /&gt;
\displaystyle\sum\limits_{n=0}^{N-1} x(n) x(n+m) &amp;lt;/math&amp;gt;. You can generate the signals randomly and filter them to obtain the band-limited signals.  ([[Jodi S. Hodge]])&lt;br /&gt;
* HW #13 - Derive the following realtions:&lt;br /&gt;
**a)      &amp;lt;math&amp;gt;DFT(x(k-l))\!&amp;lt;/math&amp;gt;&lt;br /&gt;
**b)      &amp;lt;math&amp;gt; DFT(e^{j2 \pi lk/N}x(k)\!&amp;lt;/math&amp;gt;&lt;br /&gt;
**c)      &amp;lt;math&amp;gt;\sum\limits_{k=0}^{N-1} x(k)y(k)^{*}=c\sum\limits_{k=0}^{N-1} X(n)Y(n)^{*}&amp;lt;/math&amp;gt;  ([[Hw13|Victor Shepherd)]]&lt;br /&gt;
&lt;br /&gt;
* HW #14 - Come up with a use for an adaptiveFIR filter and make an Octave script to demonstrate it.  ([[Jodi S. Hodge]])([[Hw14|Victor Shepherd)]]&lt;br /&gt;
* HW #15 - Do Practice Exam II ([[Hw15|Victor Shepherd)]]&lt;br /&gt;
* [[CW-Robot Octave Simulation]]&lt;br /&gt;
&lt;br /&gt;
==People Involved with this Wiki==&lt;br /&gt;
&lt;br /&gt;
===2012-2013 Contributors===&lt;br /&gt;
[[Brian Haddad]]&lt;br /&gt;
&lt;br /&gt;
[[Kurt Hildebrand]]&lt;br /&gt;
&lt;br /&gt;
[[Denver Lodge]]&lt;br /&gt;
&lt;br /&gt;
[[User:michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
===2011-2012 Contributors===&lt;br /&gt;
[[Matthew Blaire]]&lt;br /&gt;
&lt;br /&gt;
[[Cody Lorenz]]&lt;br /&gt;
&lt;br /&gt;
===2010-2011 Contributors===&lt;br /&gt;
[[Ben Henry|Ben Henry]]&lt;br /&gt;
&lt;br /&gt;
[[Christopher Garrison Lau I]]&lt;br /&gt;
&lt;br /&gt;
[[user:chris.wills|Chris Wills]]&lt;br /&gt;
&lt;br /&gt;
[[Jodi S. Hodge]]&lt;br /&gt;
&lt;br /&gt;
[[Luke Chilson]]&lt;br /&gt;
&lt;br /&gt;
[[Shepherd,Victor|Victor Shepherd]]&lt;br /&gt;
&lt;br /&gt;
===2009-2010 Contributors===&lt;br /&gt;
[[Nick Christman]]&lt;br /&gt;
&lt;br /&gt;
[[Joshua Sarris]]&lt;br /&gt;
&lt;br /&gt;
[[Kevin Starkey]]&lt;br /&gt;
&lt;br /&gt;
[[Max Woesner]]&lt;br /&gt;
&lt;br /&gt;
[[Jodi Hodge]]&lt;br /&gt;
&lt;br /&gt;
[[Corneliu Turturica]]&lt;br /&gt;
&lt;br /&gt;
===2008-2009 Contributors===&lt;br /&gt;
[[User:eric.clay|Eric Clay]]&lt;br /&gt;
&lt;br /&gt;
[[User:tsung-lin.yang|Chuck Yang]]&lt;br /&gt;
&lt;br /&gt;
[[User:elton.zebron|Elton Zebron]]&lt;br /&gt;
&lt;br /&gt;
[[User:Luke.chilson|Luke Chilson]]&lt;br /&gt;
&lt;br /&gt;
[[User:Brandon.price|Brandon Price]]&lt;br /&gt;
&lt;br /&gt;
[[User:Fonggr|Greg Fong]]&lt;br /&gt;
&lt;br /&gt;
===2007-2008 contributors===&lt;br /&gt;
&lt;br /&gt;
[[User:baldwin.britton|Baldwin Britton]]&lt;br /&gt;
&lt;br /&gt;
[[User:Harrde|Denver Harris]]&lt;br /&gt;
&lt;br /&gt;
[[User:Pridma|Mark Priddy]]&lt;br /&gt;
&lt;br /&gt;
[[User:ChrisRas|Chris Rasmussen]]&lt;br /&gt;
&lt;br /&gt;
[[User:RothMi|Michael Roth]]&lt;br /&gt;
&lt;br /&gt;
[[User:Rothsa|Sally Roth]]&lt;br /&gt;
&lt;br /&gt;
===2006-2007 contributors===&lt;br /&gt;
&lt;br /&gt;
[[User:Smitry|Ryan J Smith]]&lt;br /&gt;
&lt;br /&gt;
[[User:Nathan|Nathan Ferch]]&lt;br /&gt;
&lt;br /&gt;
[[User:Andrew|Andrew Lopez]]&lt;br /&gt;
&lt;br /&gt;
[[User:Sherna|Nathan Sherman]]&lt;br /&gt;
&lt;br /&gt;
[[User:Adkich|Chris Adkins]]&lt;br /&gt;
&lt;br /&gt;
===2005-2006 contributors===&lt;br /&gt;
&lt;br /&gt;
[[User:GabrielaV|Gabriela Valdivia]]&lt;br /&gt;
&lt;br /&gt;
[[User:SDiver|Raymond Betz]]&lt;br /&gt;
&lt;br /&gt;
[[User:chrijen|Jenni Christensen]]&lt;br /&gt;
&lt;br /&gt;
[[User:wonoje|Jeffrey Wonoprabowo]]&lt;br /&gt;
&lt;br /&gt;
[[User:wilspa|Paul Wilson]]&lt;br /&gt;
&lt;br /&gt;
[[User:Frohro|Instructor: Rob Frohne]]&lt;br /&gt;
&lt;br /&gt;
===2004-2005 contributors===&lt;br /&gt;
&lt;br /&gt;
[[User:Barnsa|Sam Barnes]]&lt;br /&gt;
&lt;br /&gt;
[[User:Santsh|Shawn Santana]]&lt;br /&gt;
&lt;br /&gt;
[[User:Goeari|Aric Goe]]&lt;br /&gt;
&lt;br /&gt;
[[User:Caswto|Todd Caswell]]&lt;br /&gt;
&lt;br /&gt;
[[User:Andeda|David Anderson]]&lt;br /&gt;
&lt;br /&gt;
[[User:Guenan|Anthony Guenterberg]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10652</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10652"/>
		<updated>2012-12-14T05:23:04Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear all&lt;br /&gt;
close all&lt;br /&gt;
clc&lt;br /&gt;
&lt;br /&gt;
fc = 100+rand(1)*3900                 % Carrier Frequency&lt;br /&gt;
%fc = 1500;&lt;br /&gt;
Fs = 10000;                  % Sampling frequency&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
%% Encode the message&lt;br /&gt;
&lt;br /&gt;
phase = rand(1)*2*pi;                 % Phase of the signal&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
&lt;br /&gt;
messageString = &#039;Hello World! The quick brown fox jumps over the lazy dog. ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789&#039;;&lt;br /&gt;
[message charTable] = make_bits(messageString);&lt;br /&gt;
&lt;br /&gt;
baseband = []; &lt;br /&gt;
m=1;&lt;br /&gt;
for k = 1:length(message)&lt;br /&gt;
    if(message(k)==0)&lt;br /&gt;
        baseband = [baseband, zero*m];&lt;br /&gt;
        m=-m;&lt;br /&gt;
    else&lt;br /&gt;
        baseband = [baseband, one*m];&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
t = 0:1/(Fs):length(baseband)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
v = baseband.*cos(2*pi*fc*t+phase);&lt;br /&gt;
&lt;br /&gt;
% Noise&lt;br /&gt;
v = v+randn(size(v))*10^(-10/20);&lt;br /&gt;
&lt;br /&gt;
wavwrite(v,Fs,&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
figure(1)&lt;br /&gt;
subplot(2,1,1)&lt;br /&gt;
plot(t,baseband)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,1,2)&lt;br /&gt;
plot(t,v)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband with Carrier&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
movegui(&#039;northwest&#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Decode Message&lt;br /&gt;
&lt;br /&gt;
clear all&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
% [v,Fs] = wavread(&#039;PSK31_sample.wav&#039;);&lt;br /&gt;
% [v,Fs] = wavread(&#039;capture.wav&#039;);&lt;br /&gt;
[v,Fs] = wavread(&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
t = 0:1/(Fs):length(v)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
[sout charTable] = load_alpha();&lt;br /&gt;
&lt;br /&gt;
upperNoiseCutOff = .75;&lt;br /&gt;
lowerNoiseCutOff = 1-upperNoiseCutOff;&lt;br /&gt;
&lt;br /&gt;
% figure(1)&lt;br /&gt;
% plot(v)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10651</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10651"/>
		<updated>2012-12-14T05:22:27Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Transmitter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clear all&lt;br /&gt;
&lt;br /&gt;
close all&lt;br /&gt;
clc&lt;br /&gt;
&lt;br /&gt;
fc = 100+rand(1)*3900                 % Carrier Frequency&lt;br /&gt;
%fc = 1500;&lt;br /&gt;
Fs = 10000;                  % Sampling frequency&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
%% Encode the message&lt;br /&gt;
&lt;br /&gt;
phase = rand(1)*2*pi;                 % Phase of the signal&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
&lt;br /&gt;
messageString = &#039;Hello World! The quick brown fox jumps over the lazy dog. ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789&#039;;&lt;br /&gt;
[message charTable] = make_bits(messageString);&lt;br /&gt;
&lt;br /&gt;
baseband = []; &lt;br /&gt;
m=1;&lt;br /&gt;
for k = 1:length(message)&lt;br /&gt;
    if(message(k)==0)&lt;br /&gt;
        baseband = [baseband, zero*m];&lt;br /&gt;
        m=-m;&lt;br /&gt;
    else&lt;br /&gt;
        baseband = [baseband, one*m];&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
t = 0:1/(Fs):length(baseband)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
v = baseband.*cos(2*pi*fc*t+phase);&lt;br /&gt;
&lt;br /&gt;
% Noise&lt;br /&gt;
v = v+randn(size(v))*10^(-10/20);&lt;br /&gt;
&lt;br /&gt;
wavwrite(v,Fs,&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
figure(1)&lt;br /&gt;
subplot(2,1,1)&lt;br /&gt;
plot(t,baseband)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,1,2)&lt;br /&gt;
plot(t,v)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband with Carrier&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
movegui(&#039;northwest&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Decode Message&lt;br /&gt;
&lt;br /&gt;
clear all&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
% [v,Fs] = wavread(&#039;PSK31_sample.wav&#039;);&lt;br /&gt;
% [v,Fs] = wavread(&#039;capture.wav&#039;);&lt;br /&gt;
[v,Fs] = wavread(&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
t = 0:1/(Fs):length(v)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
[sout charTable] = load_alpha();&lt;br /&gt;
&lt;br /&gt;
upperNoiseCutOff = .75;&lt;br /&gt;
lowerNoiseCutOff = 1-upperNoiseCutOff;&lt;br /&gt;
&lt;br /&gt;
% figure(1)&lt;br /&gt;
% plot(v)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10650</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10650"/>
		<updated>2012-12-14T05:21:55Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;clear all&lt;br /&gt;
&lt;br /&gt;
close all&lt;br /&gt;
clc&lt;br /&gt;
&lt;br /&gt;
fc = 100+rand(1)*3900                 % Carrier Frequency&lt;br /&gt;
%fc = 1500;&lt;br /&gt;
Fs = 10000;                  % Sampling frequency&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
%% Encode the message&lt;br /&gt;
&lt;br /&gt;
phase = rand(1)*2*pi;                 % Phase of the signal&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
&lt;br /&gt;
messageString = &#039;Hello World! The quick brown fox jumps over the lazy dog. ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789&#039;;&lt;br /&gt;
[message charTable] = make_bits(messageString);&lt;br /&gt;
&lt;br /&gt;
baseband = []; &lt;br /&gt;
m=1;&lt;br /&gt;
for k = 1:length(message)&lt;br /&gt;
    if(message(k)==0)&lt;br /&gt;
        baseband = [baseband, zero*m];&lt;br /&gt;
        m=-m;&lt;br /&gt;
    else&lt;br /&gt;
        baseband = [baseband, one*m];&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
t = 0:1/(Fs):length(baseband)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
v = baseband.*cos(2*pi*fc*t+phase);&lt;br /&gt;
&lt;br /&gt;
% Noise&lt;br /&gt;
v = v+randn(size(v))*10^(-10/20);&lt;br /&gt;
&lt;br /&gt;
wavwrite(v,Fs,&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
figure(1)&lt;br /&gt;
subplot(2,1,1)&lt;br /&gt;
plot(t,baseband)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,1,2)&lt;br /&gt;
plot(t,v)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband with Carrier&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
movegui(&#039;northwest&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%% Decode Message&lt;br /&gt;
&lt;br /&gt;
clear all&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
% [v,Fs] = wavread(&#039;PSK31_sample.wav&#039;);&lt;br /&gt;
% [v,Fs] = wavread(&#039;capture.wav&#039;);&lt;br /&gt;
[v,Fs] = wavread(&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
t = 0:1/(Fs):length(v)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
[sout charTable] = load_alpha();&lt;br /&gt;
&lt;br /&gt;
upperNoiseCutOff = .75;&lt;br /&gt;
lowerNoiseCutOff = 1-upperNoiseCutOff;&lt;br /&gt;
&lt;br /&gt;
% figure(1)&lt;br /&gt;
% plot(v)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10649</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10649"/>
		<updated>2012-12-14T05:19:10Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;clear all&lt;br /&gt;
&lt;br /&gt;
close all&lt;br /&gt;
clc&lt;br /&gt;
&lt;br /&gt;
fc = 100+rand(1)*3900                 % Carrier Frequency&lt;br /&gt;
%fc = 1500;&lt;br /&gt;
Fs = 10000;                  % Sampling frequency&lt;br /&gt;
baud = 31.25;&lt;br /&gt;
&lt;br /&gt;
%% Encode the message&lt;br /&gt;
&lt;br /&gt;
phase = rand(1)*2*pi;                 % Phase of the signal&lt;br /&gt;
dt = 0:1/Fs:1/baud-1/Fs;   % Time between samples&lt;br /&gt;
one = ones(size(dt));       % A &#039;One&#039; signal&lt;br /&gt;
zero = cos(pi*dt*baud);    % A &#039;Zero&#039; signal&lt;br /&gt;
&lt;br /&gt;
messageString = &#039;Hello World! The quick brown fox jumps over the lazy dog. ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789&#039;;&lt;br /&gt;
[message charTable] = make_bits(messageString);&lt;br /&gt;
&lt;br /&gt;
baseband = []; &lt;br /&gt;
m=1;&lt;br /&gt;
for k = 1:length(message)&lt;br /&gt;
    if(message(k)==0)&lt;br /&gt;
        baseband = [baseband, zero*m];&lt;br /&gt;
        m=-m;&lt;br /&gt;
    else&lt;br /&gt;
        baseband = [baseband, one*m];&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
t = 0:1/(Fs):length(baseband)/Fs-1/Fs;&lt;br /&gt;
&lt;br /&gt;
v = baseband.*cos(2*pi*fc*t+phase);&lt;br /&gt;
&lt;br /&gt;
% Noise&lt;br /&gt;
v = v+randn(size(v))*10^(-10/20);&lt;br /&gt;
&lt;br /&gt;
wavwrite(v,Fs,&#039;signal.wav&#039;);&lt;br /&gt;
&lt;br /&gt;
figure(1)&lt;br /&gt;
subplot(2,1,1)&lt;br /&gt;
plot(t,baseband)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
subplot(2,1,2)&lt;br /&gt;
plot(t,v)&lt;br /&gt;
axis([0 2 -1.2 1.2])&lt;br /&gt;
title(&#039;\fontsize{14}Baseband with Carrier&#039;)&lt;br /&gt;
xlabel(&#039;Time (s)&#039;)&lt;br /&gt;
ylabel(&#039;Amplitude&#039;)&lt;br /&gt;
movegui(&#039;northwest&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10648</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10648"/>
		<updated>2012-12-14T05:05:34Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Test Code&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10647</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10647"/>
		<updated>2012-12-14T05:02:35Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Code Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10646</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10646"/>
		<updated>2012-12-14T04:54:47Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Results/Problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
===Receiver===&lt;br /&gt;
As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10645</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10645"/>
		<updated>2012-12-14T04:53:25Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
&lt;br /&gt;
*As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
&lt;br /&gt;
===Receiver===&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
In most cases, our guess frequency is within 0.2Hz of the actual frequency. As the guess frequency exceeds these bounds, the text decode becomes increasingly garbled.&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10644</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10644"/>
		<updated>2012-12-14T04:52:16Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
&lt;br /&gt;
*As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
&lt;br /&gt;
===Receiver===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Frequency Errors ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10643</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10643"/>
		<updated>2012-12-14T04:51:23Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Transmitter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*To our knowledge, our transmitter generates a signal without any problems.&lt;br /&gt;
&lt;br /&gt;
*As long as our guess frequency is close to the actual frequency, (less than 0.1Hz off) our receiver can easily handle a 1dB SNR.&lt;br /&gt;
&lt;br /&gt;
===Receiver===&lt;br /&gt;
&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10642</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10642"/>
		<updated>2012-12-14T04:50:06Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Results/Problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
===Transmitter===&lt;br /&gt;
&lt;br /&gt;
===Receiver===&lt;br /&gt;
&lt;br /&gt;
==== PID Controller Problems ====&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10641</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10641"/>
		<updated>2012-12-14T04:48:41Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Transmitter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png|600px]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10640</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10640"/>
		<updated>2012-12-14T04:48:32Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. [[File:K&amp;amp;M_Sync_Points.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10639</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10639"/>
		<updated>2012-12-14T04:46:24Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_PSK31Signal.png&amp;diff=10638</id>
		<title>File:K&amp;M PSK31Signal.png</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_PSK31Signal.png&amp;diff=10638"/>
		<updated>2012-12-14T04:45:28Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: Undo revision 10637 by Michael.vonpohle (Talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_PSK31Signal.png&amp;diff=10637</id>
		<title>File:K&amp;M PSK31Signal.png</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_PSK31Signal.png&amp;diff=10637"/>
		<updated>2012-12-14T04:44:46Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10636</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10636"/>
		<updated>2012-12-14T04:44:02Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We read in the signal from a wav file and generate utility variables and matrices.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10635</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10635"/>
		<updated>2012-12-14T04:32:14Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png|600px]]&lt;br /&gt;
# We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. &lt;br /&gt;
# We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&lt;br /&gt;
# We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10634</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10634"/>
		<updated>2012-12-14T04:31:07Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&amp;lt;br/&amp;gt;[[File:K&amp;amp;M_Signal_Mixed_and_Filtered.png]]&lt;br /&gt;
# We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. &lt;br /&gt;
# We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&lt;br /&gt;
# We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10633</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10633"/>
		<updated>2012-12-14T04:30:07Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Transmitter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&amp;lt;br/&amp;gt;[[Image:K&amp;amp;M_PSK31Signal.png]]&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&lt;br /&gt;
# We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. &lt;br /&gt;
# We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&lt;br /&gt;
# We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_Sync_Points.png&amp;diff=10632</id>
		<title>File:K&amp;M Sync Points.png</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_Sync_Points.png&amp;diff=10632"/>
		<updated>2012-12-14T04:29:04Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_Signal_Mixed_and_Filtered.png&amp;diff=10631</id>
		<title>File:K&amp;M Signal Mixed and Filtered.png</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_Signal_Mixed_and_Filtered.png&amp;diff=10631"/>
		<updated>2012-12-14T04:28:46Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_PSK31Signal.png&amp;diff=10630</id>
		<title>File:K&amp;M PSK31Signal.png</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=File:K%26M_PSK31Signal.png&amp;diff=10630"/>
		<updated>2012-12-14T04:28:13Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10629</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10629"/>
		<updated>2012-12-14T04:24:16Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&lt;br /&gt;
# We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. &lt;br /&gt;
# We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&lt;br /&gt;
# We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10628</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10628"/>
		<updated>2012-12-14T04:21:38Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&lt;br /&gt;
# We mark the locations where the filtered signal changes sign. This identifies possible &amp;quot;sync&amp;quot; points where zeros in the signal may occur. &lt;br /&gt;
&lt;br /&gt;
# We compare the length of time that occurs between each sync point with the baud rate to determine how many baud periods occur between each sync point. A single baud period indicates a zero. Each additional period over the first baud period indicates a one. (Ex. Three baud periods -&amp;gt; &#039;110&#039;)&lt;br /&gt;
# We send the resulting bit stream through a text decoder which translates the ones and zeros into a text message.&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10627</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10627"/>
		<updated>2012-12-13T08:47:26Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&lt;br /&gt;
# We mark the locations where the filtered signal changes sign&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Authors==&lt;br /&gt;
&lt;br /&gt;
[[User:Michael.vonpohle|Michael von Pohle]]&lt;br /&gt;
&lt;br /&gt;
[[Hildebrand,_Kurt|Kurt Hildebrand]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10626</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10626"/>
		<updated>2012-12-13T08:40:32Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&lt;br /&gt;
# We mark the locations where the filtered signal changes sign&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10625</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10625"/>
		<updated>2012-12-13T08:31:12Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# A PID controller was implemented to help offset the fact that a carrier frequency derived from the FFT produces an inaccurate carrier frequency. An offset in the carrier frequency causes the constellation diagram to rotate in a circle. The PID tries to compensate for this by adding to or subtracting from the phase of the signal while trying to drive the Q-component of the signal to zero. The feedback loop is described by the code below.&lt;br /&gt;
&amp;lt;source Lang=&amp;quot;Matlab&amp;quot;&amp;gt;&lt;br /&gt;
 % PID controller constants&lt;br /&gt;
 Kp = 25;&lt;br /&gt;
 Ki = 50;&lt;br /&gt;
 Kd = 1;&lt;br /&gt;
 output = zeros(1, length(v));    % Init&lt;br /&gt;
 setpoint = 0;                    % Sets the feedback point to control to.&lt;br /&gt;
 previous_error = 0;                % In this case, you want to set yt to 0.&lt;br /&gt;
 integral = 0;&lt;br /&gt;
 xt_filt = [];&lt;br /&gt;
 yt_filt = [];&lt;br /&gt;
 for k=51:length(v)&lt;br /&gt;
    xt(k) = v(k)*cos(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
    yt(k) = v(k)*sin(2*pi*u_fc*t(k)+output(k));&lt;br /&gt;
   &lt;br /&gt;
    xt_filt(k:-1:k-50) = filter(b, a, xt(k:-1:k-50));&lt;br /&gt;
    yt_filt(k:-1:k-50) = filter(b, a, yt(k:-1:k-50));&lt;br /&gt;
   &lt;br /&gt;
    if(sign(xt(k)) == sign(yt(k)))&lt;br /&gt;
        error = setpoint - yt_filt(k);&lt;br /&gt;
    else&lt;br /&gt;
        error = setpoint + yt_filt(k);&lt;br /&gt;
    end&lt;br /&gt;
   &lt;br /&gt;
    % PID Feedback Controller compensates for inaccurate fc guess.&lt;br /&gt;
    % error = setpoint - yt_filt(k);&lt;br /&gt;
    integral = integral + error*10;&lt;br /&gt;
    derivative = (error - previous_error)/10;&lt;br /&gt;
    output(k+1) = Kp*error + Ki*integral + Kd*derivative;&lt;br /&gt;
    previous_error = error;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&lt;br /&gt;
# We mark the locations where the filtered signal changes sign&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;br /&gt;
&lt;br /&gt;
=== PID Controller Problems ===&lt;br /&gt;
The first iteration did not take into account the I component of the signal and was constantly trying to drive the signal to the positive I coordinates. A smiple if-else statement solved this problem. However there are some bugs. There might be a singularity at (0,0) which causes the controller to perform in a strange fashion. Also, the code has very bad noise rejection. It can produce baseband but not very well once noise is added. Finally, it doesn&#039;t decode signals that we generate ourselves. When we produce our signal in MATLAB, the code works fine. However, the signal from wikipedia.com and Dr. Frohne&#039;s signal don&#039;t work. One problem with the wikipedia.com signal is that it&#039;s native format is .ogg which is lossy. This could&#039;ve presented problems when we convert the signal to a wave file as high frequencies get chopped in lossy formats.&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10596</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10596"/>
		<updated>2012-12-13T04:30:18Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# PID stuff &#039;&#039;&#039;&#039;&#039;(Do you want to go into detail here Kurt?)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&lt;br /&gt;
# We mark the locations where the filtered signal changes sign&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10594</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10594"/>
		<updated>2012-12-13T04:23:22Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# PID stuff &#039;&#039;&#039;&#039;&#039;(Do you want to go into detail here Kurt?)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10593</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10593"/>
		<updated>2012-12-13T04:23:05Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the signal from a wav file and generate utility variables and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# PID stuff &#039;&#039;&#039;&#039;&#039;(Do you want to go into detail here Kurt?)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
# We multiply the signal with a cosine wave at our guess frequency. This splits the signal into two parts: a high frequency component (with frequency equal to the sum of the &#039;&#039;actual&#039;&#039; carrier frequency and our &#039;&#039;guess&#039;&#039; frequency) and a low frequency component (due to the difference of the two frequencies). &lt;br /&gt;
&lt;br /&gt;
# We filter the multiplied signal through a butterworth filter with a 75Hz cutoff frequency to remove the high frequency component.&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10591</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10591"/>
		<updated>2012-12-13T04:18:03Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the message from a wav file and generate utility signals and matrices.&lt;br /&gt;
# We run the signal through an FFT and take an average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
# PID stuff &#039;&#039;&#039;&#039;&#039;(Do you want to go into detail here Kurt?)&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10590</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10590"/>
		<updated>2012-12-13T04:16:52Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the message from a wav file and generate utility signals and matrices.&lt;br /&gt;
# We run the signal through an FFT and average over the range of the FFT spike to obtain a carrier frequency guess.&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10589</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10589"/>
		<updated>2012-12-13T04:15:42Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Receiver */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split into several steps:&lt;br /&gt;
# We read in the message from a wav file and generate utility signals and matrices.&lt;br /&gt;
&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10588</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10588"/>
		<updated>2012-12-13T04:12:40Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
&lt;br /&gt;
==== Transmitter ====&lt;br /&gt;
&lt;br /&gt;
Our code creates a PSK31 signal given an input carrier frequency and message. For testing our receiver code, the transmitter is setup to generate a random carrier frequency and phase. It also adds random noise to the signal before writing it to a wav file.&lt;br /&gt;
&lt;br /&gt;
==== Receiver ====&lt;br /&gt;
Our receiver is split&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10587</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10587"/>
		<updated>2012-12-13T04:09:47Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;br /&gt;
=== Code Overview ===&lt;br /&gt;
=== Code ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Results/Problems ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10586</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10586"/>
		<updated>2012-12-13T04:07:52Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;br /&gt;
&lt;br /&gt;
== Our Approach ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10584</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10584"/>
		<updated>2012-12-13T04:04:22Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to design and code a Matlab script that will encode and decode a PSK31 signal including signals with noise. The receiver should be able to read in signals (as a wav file) from other sources as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PSK31 is a audible text encoding that can be sent over the air by amateur radio operators. A computer&#039;s sound card can be used to send and receive the signal since the signal is audible. For more information regarding PSK31 see the Wikipedia article.[http://en.wikipedia.org/wiki/PSK31]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10583</id>
		<title>PSK31 Demodulation (Kurt &amp; Michael)</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=PSK31_Demodulation_(Kurt_%26_Michael)&amp;diff=10583"/>
		<updated>2012-12-13T03:58:28Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: Created page with &amp;#039;== THE PROJECT!!! ==&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== THE PROJECT!!! ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10582</id>
		<title>User:Michael.vonpohle</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10582"/>
		<updated>2012-12-13T03:58:11Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: /* Projects/Pages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General Information ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&#039;m an Electrical Engineering Major and have attended Walla Walla since 2009. I plan to graduate in 2013. This page contains a summary of my contributions to the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects/Pages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[PSK31 Demodulation (Kurt &amp;amp; Michael)]]&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
	<entry>
		<id>https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10580</id>
		<title>User:Michael.vonpohle</title>
		<link rel="alternate" type="text/html" href="https://fweb.wallawalla.edu/class-wiki/index.php?title=User:Michael.vonpohle&amp;diff=10580"/>
		<updated>2012-12-13T03:49:19Z</updated>

		<summary type="html">&lt;p&gt;Michael.vonpohle: Created page with &amp;#039;== General Information ==   I&amp;#039;m an Electrical Engineering Major and have attended Walla Walla since 2009. I plan to graduate in 2013. This page contains a summary of my contribut…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General Information ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&#039;m an Electrical Engineering Major and have attended Walla Walla since 2009. I plan to graduate in 2013. This page contains a summary of my contributions to the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects/Pages ==&lt;/div&gt;</summary>
		<author><name>Michael.vonpohle</name></author>
	</entry>
</feed>