```r
# calculate spectra reconstructed by dct() 
sS.dftlong.mean = sS.dftlong.mean %>%
  group_by(labels) %>%
  mutate(reconstructed = emuR::dct(track_value,fit=T))


#plot the reconstructed spectral slices
ggplot(sS.dftlong.mean) +
  aes(x = freq, y = reconstructed,col=labels) +
  geom_line()
```

<img src="SpectralAnalysis_files/figure-html/unnamed-chunk-18-1.png" width="672" style="display: block; margin: auto;" />

```r
# this is obviously exactly the same as the original data: 

ggplot(sS.dftlong.mean) +
  aes(x = freq, y = track_value,col=labels) +
  geom_line()
```

<img src="SpectralAnalysis_files/figure-html/unnamed-chunk-18-2.png" width="672" style="display: block; margin: auto;" />