# Normalization of a signal with respect to another signal

Imagine that I gave one signal (call it master signal) with respect to which I would like to normalize all the others. How should I treat it mathematically? Any ideas?

• You'll need to define "normalize one signal with respect to another". As a possibility, you could normalize all signals to have the same energy as the "master" signal. Without this definition, your question makes no sense. – MBaz Mar 26 '18 at 14:17
• Is your “master” with or without additive noise? – user28715 Mar 26 '18 at 14:32

I think I understand what Vasilis is after with this question, so I will attempt to clarify for all, and answer.
Let x(0...N-1) be a predetermined reference signal.
Let y(0...N-1) be another signal. We presume that y is a noisy, scaled version of x, with an unknown scale factor.
We wish estimate the scale factor, and use that to rescale y so it is ostensibly a noisy version of x, with identical scale.
Calculate the autocorrelation of x: rxx = sum(abs(x(k))^2), k=0...N-1
Calculate the cross-correlation of x and y: rxy = sum(conj(x(k))*y(k)), k=0...N-1
Estimate the scale factor: est_A = rxy / rxx.
Let scaled_y = y / est_A (unless est_A is zero).
Vasilis refers to "all others"; repeat this procedure with y set to each of the "other" signals. This works for real and complex data.

Here is a Matlab function which demonstrates this technique.

function a20180326_normalize_demo
% Demonstrates normalization of a signal.

%----------------------------------------------------------------
% configure & initialize
%----------------------------------------------------------------
% Reference signal.
x = 1-2*[0 1 0 0 1 1 0 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 ];
A = 1.25; % Scale factor.
noise_power=  0.1;
noise = randn(size(x)) * sqrt(noise_power);
y = A * x + noise;

%----------------------------------------------------------------
% estimate & normalize
%----------------------------------------------------------------
% The inputs to this estimation algorithm are x and y.
rxx = sum(abs(x).^2);
rxy = sum(conj(x).*y);
est_A = rxy / rxx;
if est_A==0, error('Attempted division by 0.'); end;
normalized_y = y / A;

fprintf(1, 'A = %g, est_A = %g\n', A, est_A);
figure(1);
clf;
n = 0 : length(x)-1;
hx = plot(n,x, 'bo');
hold on;
hy = plot(n,normalized_y, 'g-');
legend([hx hy], 'master signal', 'normalized signal');
grid on;