Hey there.
I'm working with FSK generation and decoding. I currently have generated a signal containing 3 characters. These characters have been assigned different frequencies with my generator script.
I have made a spectrogram analysis of the signal:
Now I want to identify the different frequencies. I have tried everything from max, findpeaks etc. But when I convert my signal with the spectrogram function, I end up with entirely different frequencies and peaks. I have also made DFT analysis of my signal, but I end up with weird results. BTW. I have made a script that divided the signal into 3 parts (in this case of 1 second). Now I just need to find the dominant frequency during this time period.
Generator code:
function x = FSKgenerator(mysymbolseq, fstart, fend, Tsymbol, fs)
farray = linspace(fstart, fend, 256);
A = 1;
n = 0:(round(Tsymbol*fs)-1);
myids = double(mysymbolseq);
x = [];
for i=1:length(myids),
myfreq = farray(myids(i));
sig = A*cos(2*pi*n*myfreq/fs);
x = [x sig];
end
Code for generating this signal:
clc, clear, close all
fstart = 1000;
fend = 2000;
Tsymbol = 1;
fs = 10000;
signal = FSKgenerator('Hej', fstart, fend, Tsymbol, fs);
figure(1)
spectrogram(signal, hanning(1000), 0, 500, fs)