Hey guys

I’m trying to plot the FFT for a waveform which basically has three plots:

the first plot has waveforms for the same wire plotted on top of each other

the second plot has the difference between the two waveforms

the third plot should be the FFT of the first plot, so it should have the FFT of the waveforms plotted on top of each other.

I have attached the plots and also my code.

Just to save you some time, here’s how i define my histograms:

TH1F *WaveformHistCV_Chan1500 = new TH1F(“WaveformHistCV_Chan1500”,“Channel 1500 Waveform;Time Tick;ADC Value”,maxTicks,-0.5,maxTicks-0.5);

```
WaveformHistCV_Chan1500->GetYaxis()->SetTitleOffset(1.2);
```

TH1F *WaveformHistWhitenoise_Chan1500 = new TH1F(“WaveformHistWhitenoise_Chan1500”,“Channel 1500 Waveform;Time Tick;ADC Value”,maxTicks,-0.5,maxTicks-0.5);

```
WaveformHistWhitenoise_Chan1500->GetYaxis()->SetTitleOffset(1.2);
TH1* fftHistCV=0;
TVirtualFFT::SetTransform(0);
fftHistCV=WaveformHistCV_Chan1500->FFT(WaveformHistCV_Chan1500,"MAG");
TH1* fftHistWhitenoise=0;
TVirtualFFT::SetTransform(0);
fftHistWhitenoise=WaveformHistWhitenoise_Chan1500->FFT(WaveformHistWhitenoise_Chan1500,"MAG");
```

Ar39Study.cpp (7.6 KB)
For some reason instead of getting the third plot as FFT it’s the same as the first plot, which i don’t want. I simply want the FFT.

Any help is appreciated.

Thanks !