tic
info = audioinfo("Arecibo_message_DTMF.ogg")
[yy,fs]=audioread("Arecibo_message_DTMF.ogg");
yy = yy(:,1);
N = 5000;
fs = 100000;
f = 941
k = 0.5 + (N * f/fs)
w = 2 * pi * k / N
cosine = cos (w)
sine = sin(w)
coeff = 2 * cosine
start = 1;
len = 5000;
RES2 = zeros(73,23);
x=0;y=1;
M = [];
for bits = 1:1679
  y1 = yy(start:start+len);
  Q0 = Q1 = Q2 = 0;
  for n = 1 : N
    Q0 = coeff * Q1 - Q2 + y1(n);
    Q2 = Q1;
    Q1 = Q0;
  endfor
  Q = (Q1 - Q2 * cosine) + i * (Q2 * sine);
  mag = abs(Q);
  M(bits) = mag;
  x = x + 1;
  if (x==24)
    x = 1;
    y = y + 1;
  endif
  if mag < 200
    RES2(y,x) = 1;
  endif
  start = start + 2 * len;
endfor
figure()
imshow(RES2)
title("ARECIBO MESSAGE");
toc






