# Comparing PSD two signals of different length

I have two time signals A and B which are of different length, length(A) < length(B). Now I calculated the cumulative PSD of both signals. What is the best way to compare this result?

If I am correct you can not compare them directly because they are of different length. What is the best to compare them? I tried normalize them by dividing the PSD result by the length of the signal, but I am not sure this is actually a valid approach.

Note, I am not interested in the common frequencies I am interested in the energy content.

• To clarify: is the sampling frequency of both signals equal? Are you interested in which signal has more energy or more power? – Maximilian Matthé Nov 18 '16 at 9:07
• Sample time is identical. – WG- Nov 18 '16 at 10:42

I am not interested in the common frequencies I am interested in the energy content.

You might be fooling yourself. Parseval's theorem clearly states that the energy in time is the same as the energy in frequency domain. Thus, if you're just after energy, your question's title makes little sense.

samples -> DFT -> |·|² -> Σ


you can just

samples- > |·|² -> Σ


and get exactly the same result.

That clears up the question: If you're dividing the sum of magnitude square samples by the number of samples, you get an "Energy per time", which is power. That's a fair comparison for two signals. But then, you're comparing powers, not energies, and that might contradict your problem statement.

general advice: Taking a few guesses here, namely that you are a student relatively fresh into DSP, and you will need to hand in some kind of report or go through some kind of exam or lab demo on this stuff.

Just write down exactly what you're looking for, in mathematical notation. That will do two things:

1. it's much easier to spot such "terminology" mishaps like Energy vs Power, because you're suddenly sitting in front of a paper that says "looking for energy $P$" and you'll start to wonder why it is called $P$.
2. It's much easier to apply the things you've learnt in theoretical classes when your problem is already in the same "language". For example, I'm pretty optimistic that you've heard of energy and power signals, and even Parseval might have come up. Especially in such normalization questions like you have it, just seeing and discussing the formula helps a lot – because, later on, you will have the chance to define things yourself, and often, things are really easy to name and understand when you see them as formula and go "oh, this is a sum of magnitude squares – let's call this energy", and vice versa, someone tells you about energy in images, and you'll instantly realize that an image is just a boring 2D signal, and thus, energy will just be "sum over all rows over all colums of color intensity squares".
• You are totally correct, forgot about that. Main problem is that I have two signals which are traces of the error of a system. In both signals the same action (but with different accelerations/velocities) is performed. However, in one signal extra idle time appended. However it is hard to (automatically) remove the samples in which the system is "idle", i.e., setpoint of zero but still there is still an error due to other contributions of the system. Guess I will just remove the idle time manually. – WG- Nov 18 '16 at 10:42