# phyphox Forums

Full Version: Xmas receiver mathematical insights
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm into a project at school and i need to know everything mathematical/physical about the xmas receiver experiment (Fourier transform, all the frequencies used, phyphox algorithm to decrypt...) can somebody help me? (https://phyphox.org/xmas/)
Technically, https://phyphox.org/xmas/ already provides most of the information: the general principle is explained and the .phyphox file is open source (see https://phyphox.org/wiki/index.php/Phyphox_file_format).

I try to break it down a bit. The audio file plays four concurrent notes, one each in the ranges [749…2249] (x coordinate), [2249…3749] (y coordinate), [3749…5249] (color and repeat), and [5249…5624] (checksum) Hertz. Each segment is divided into subranges of the width 48000/2048=23.4375 Hz. On each of these range a FFT is mapped and in each the maximum is searched.

If the maximum of the first range is in the nx-th segment, then the x coordinate is this nx (1…64).
If the maximum of the second range is in the ny-th segment, then the y coordinate is this ny (1…64).
If the maximum of the third range is in the n-th segment, then the remainder of n divided by 8 gives the color (0…7) and the quotient of n divided by 8 (the integer part of n/8) tells how often the point should be repeated in x direction (internally we add one, so 1…8 is the possible length of the horizontal block in the graph).
If the maximum of the forth range is in the c-th segment, then the remainder of (nx+ny+n) divided by 16 needs to match c–1 (0…15) or the entire point is discarded.

HTH a bit.
You could try to decode some points with the help of the “Audio Spectrum”. In the “History” tab you could tap on the waterfall diagram, in order to show it fullscreen, and then tap on the (almost) white maxima to obtain the individual frequencies…
(05-05-2023, 06:08 PM)Jens Noritzsch Wrote: [ -> ]Technically, https://phyphox.org/xmas/ already provides most of the information: the general principle is explained and the .phyphox file is open source (see https://phyphox.org/wiki/index.php/Phyphox_file_format).

I try to break it down a bit. The audio file plays four concurrent notes, one each in the ranges [749…2249] (x coordinate), [2249…3749] (y coordinate), [3749…5249] (color and repeat), and [5249…5624] (checksum) Hertz. Each segment is divided into subranges of the width 48000/2048=23.4375 Hz. On each of these range a FFT is mapped and in each the maximum is searched.

If the maximum of the first range is in the nx-th segment, then the x coordinate is this nx (1…64).
If the maximum of the second range is in the ny-th segment, then the y coordinate is this ny (1…64).
If the maximum of the third range is in the n-th segment, then the remainder of n divided by 8 gives the color (0…7) and the quotient of n divided by 8 (the integer part of n/8) tells how often the point should be repeated in x direction (internally we add one, so 1…8 is the possible length of the horizontal block in the graph).
If the maximum of the forth range is in the c-th segment, then the remainder of (nx+ny+n) divided by 16 needs to match c–1 (0…15) or the entire point is discarded.

HTH a bit.

Thanks, i'll start from this. I have the idea of trying to use the generator and analyze the spectrum of the .wav file when encrypting RGB images (for example: completely white or green or blue or red or green) to see how it works.
I should have mentioned that you could find the encoder in the source of https://phyphox.org/xmas-generator-2021.html (it's plain uncompressed javascript). That's likely much easier to read than the phyphox file format…
(05-12-2023, 10:17 AM)Jens Noritzsch Wrote: [ -> ]I should have mentioned that you could find the encoder in the source of https://phyphox.org/xmas-generator-2021.html (it's plain uncompressed javascript). That's likely much easier to read than the phyphox file format…

Hello, sorry again, i dont quite understand this part of the code:

function hue2index(h, s, v) {
if (s < 0.5) {
return 7; //White
} else {
if (h < 0.083333333) {
return 3; //red
} else if (h < 0.25) {
return 4; //yellow
} else if (h < 0.416666667) {
return 5; //green
} else if (h < 0.583333333) {
return 6; //cyan
} else if (h < 0.75) {
return 1; //blue
} else if (h < 0.916666667) {
return 2; //magenta
} else {
return 3; //red (again)
}

Mainly i dont understand where 0.0833333, 0.4166666 .... come from. Thanks in advance
Hue is –simplified– an angle on the color circle, see https://en.wikipedia.org/wiki/Hue, for instance. The identification of colors can thus be reduced to a single number rather than multiple in other color spaces.
(05-15-2023, 02:25 PM)Jens Noritzsch Wrote: [ -> ]Hue is –simplified– an angle on the color circle, see https://en.wikipedia.org/wiki/Hue, for instance. The identification of colors can thus be reduced to a single number rather than multiple in other color spaces.

Hey, i did the spectrum of the "most common" colors to analyze their spectrum. This is the result, what can i understand from it? Thanks