adding parts of waves and performing fft

I have five 30s long waves which I would like to split up into two different waves, one from x=3.5 to 16.5 s -- where some experimental treatment is occuring- and the rest as another wave(as a control if you will)(containing 0-3.5 and 16.5 -30 s data).

I would then like to add all these segments of waves coming from both parts of the original waves so that I get one wave which has all the information of all the 3.5-16.5 seconds of all the five waves and similarly for the other final wave, as a continuous wave. Then I would like to perform fft on these waves to compare the frequencies in each of the two final stitched up waves. How can I go about doing this and is this OK from a signal processing point of view?

Is it possible to write a small script to automate this as much as possible?
I managed to do this manually by using concatenate and Duplicating waves. Could someone guide me as to how to create and compare the power spectra of these two waves?
Another question I have is that I was trying to use the DSPPeriodogram function with the /cohr tag to measure coherence between two waves but it gave me an error saying "Wave length mismatch" . Is there a way around this?
epiphenom wrote:
Could someone guide me as to how to create and compare the power spectra of these two waves?


You should probably use DSPPeriodogram. The details, i.e., flags and options depend on your application.

Quote:
Another question I have is that I was trying to use the DSPPeriodogram function with the /cohr tag to measure coherence between two waves but it gave me an error saying "Wave length mismatch" . Is there a way around this?


The operation requires that both waves have the same length. For example:
make/n=1000 ddd=enoise(10)
make/n=1000 eee=enoise(10)
dspperiodogram/cohr ddd,eee  // this works

but
make/n=1002 fff=enoise(10)
dspperiodogram/cohr ddd,fff  // returns an error


I hope this helps,

A.G.
WaveMetrics, Inc.