# Orthogonal signals in frequency and time domains [closed]

I have 3 orthogonal signals obtained by Fourier transformation. But when I do the inverse Fourier transform in Matlab, my signals are no longer orthogonal in the time domain.

Here is my question:

How to keep the orthogonality of signals in the time domain?

• Can you maybe post a minimal code example of what you are talking about, just for the sake of demonstration of the situation you are faced with? – A_A Aug 8 '18 at 16:36
• if you do it right, the inner product is preserved by a (discrete) Fourier transform. So you must be doing something wrong. And that implies you need to show your work before you can receive a meaningful answer. – Jazzmaniac Aug 8 '18 at 18:35

Preamble: a scalar product is a positive semi-definite bilinear form, and we will suppose here we want the standard definitions.

Using their Fourier domain is (one of) the simplest way to construct orthogonal signals. It suffices to choose signals with disjoint frequency supports. Note that is not a necessary condition: some signals can be orthogonal with the same frequency supports, like $\cos$ and $\sin$, and more generally Hilbert transform pairs.

This is due to the Parseval-Plancherel theorem (inner product and norm preservation under Fourier transform): with disjoint frequency support, the scalar product is zero, and hence the vectors are orthogonal.

So in the following results, we take a random spectrum for a real signal. We then segment it into three subsets of points, mutually exclusive, and whose union give the full frequency axis. And then do an inverse FFT to obtain three subsignals whose inner products are:

S1.S2 = -4.7705e-18
S2.S3 = 1.7564e-17
S3.S1 = -1.2645e-17


The corresponding signals and spectra are displayed below, and the code follows (in Matlab): function seDsp51117(nSample)

if nargin < 1
nSample = 512;
end
nSampleHalfSpectrum = nSample/2+1;
halfSpectrum = randn(nSampleHalfSpectrum,1)+1i*randn(nSampleHalfSpectrum,1);
halfSpectrum(1) = real(halfSpectrum(1));
halfSpectrum(end) = real(halfSpectrum(end));
nSampleSpectrum1 = ceil(nSampleHalfSpectrum*rand(1));
nSampleSpectrum2 = ceil((nSampleHalfSpectrum-nSampleSpectrum1)*rand(1));
nSampleSpectrum3 = nSampleHalfSpectrum - nSampleSpectrum1 - nSampleSpectrum2;

idxSpectrumRand   = randperm(nSampleHalfSpectrum);
bndSpectrumRand = round(linspace(1,nSampleHalfSpectrum+1,4));

idxSpectrum1 = idxSpectrumRand(bndSpectrumRand(1):bndSpectrumRand(2)-1);
idxSpectrum2 = idxSpectrumRand(bndSpectrumRand(2):bndSpectrumRand(3)-1);
idxSpectrum3 = idxSpectrumRand(bndSpectrumRand(3):bndSpectrumRand(4)-1);

[signal,halfSpectrumSelect] = IFFTReal(halfSpectrum);
[signal1,halfSpectrumSelect1] = IFFTReal(halfSpectrum,idxSpectrum1);
[signal2,halfSpectrumSelect2] = IFFTReal(halfSpectrum,idxSpectrum2);
[signal3,halfSpectrumSelect3] = IFFTReal(halfSpectrum,idxSpectrum3);
figure(1);clf
subplot(4,2,1)
plot((signal));axis tight;grid on
xlabel('Original signal')
subplot(4,2,3)
plot((signal1));axis tight;grid on
xlabel('Subsignal S1')
subplot(4,2,5)
plot((signal2));axis tight;grid on
xlabel('Subsignal S2')
subplot(4,2,7)
plot((signal3));axis tight;grid on
xlabel('Subsignal S3')

subplot(4,2,2);hold on
plot(abs([halfSpectrumSelect]),'o');
plot(abs([halfSpectrumSelect]),'x');
xlabel('Original spectrum')
axis tight;grid on
subplot(4,2,4);hold on
plot(abs([halfSpectrumSelect]),'o');
plot(abs([halfSpectrumSelect1]),'x');
axis tight;grid on
xlabel('Subsignal spectrum for S1')

subplot(4,2,6);hold on
plot(abs([halfSpectrumSelect]),'o');
plot(abs([halfSpectrumSelect2]),'x');
axis tight;grid on
xlabel('Subsignal spectrum for S2')
subplot(4,2,8);hold on
plot(abs([halfSpectrumSelect]),'o');
plot(abs([halfSpectrumSelect3]),'x');
axis tight;grid on
xlabel('Subsignal spectrum for S3')

sp12 = dot(signal1,signal2);
sp23 = dot(signal2,signal3);
sp31 = dot(signal3,signal1);

disp(['S1.S2 = ',num2str(sp12)]);
disp(['S2.S3 = ',num2str(sp23)]);
disp(['S3.S1 = ',num2str(sp31)]);

function [signal,halfSpectrumSelect] = IFFTReal(halfSpectrum,idxSpectrum)
if nargin < 2
idxSpectrum = 1:length(halfSpectrum);
end
halfSpectrumSelect = zeros(size(halfSpectrum));
halfSpectrumSelect(idxSpectrum) = halfSpectrum(idxSpectrum);

%% Hermitian glue
wholeSpectrum = [halfSpectrumSelect;conj(flipud(halfSpectrumSelect(2:end-1)))];
ratioImagReal = 10^(-6);
tmp = ifft(wholeSpectrum);
normRatio =  norm(imag(tmp),1)/norm(real(tmp),1);
signal = real(tmp);
if normRatio > ratioImagReal
warning('Check the imaginery value');
end


There is nowhere it will occur if the signal is orthogonal in freqecey domain then it is orthogonal in time domain.the Fourier transform is just a tool to convert one to another it will not change signal properties(maybe even and odd), the orthogonality in time domain is defined between two signals f(x) & g(x) as$\int( f(x).g(x)dx) =0$ for one period if it is periodic or the entire signal, hope it is helpful

• Uhm. Punctuation? – Jazzmaniac Aug 8 '18 at 20:02
• Do you mean dot product? :) – Laurent Duval Aug 8 '18 at 20:14
• This answer might be good (or not) content-wise – I really don't know, because without a single "." to divide sentences from each other, I really can't understand what's said here. So, sadly, that makes the question bad :( I'll happily retract my downvote if you could add punctuation! – Marcus Müller Aug 9 '18 at 9:43