```r
sS.dftlong.mean = sS.dftlong.mean %>%
  group_by(labels) %>%
  mutate(#you can't use m=0 in order to calculate k0 only
  smoothed_k0tok1 = emuR::dct(track_value,m=1,fit=T),
  smoothed_k0tok2 = emuR::dct(track_value,m=2,fit=T),
  smoothed_k0tok3 = emuR::dct(track_value,m=3,fit=T),
  smoothed_k0tok4 = emuR::dct(track_value,m=4,fit=T),
  smoothed_k0tok5 = emuR::dct(track_value,m=5,fit=T),
  smoothed_k0tok6 = emuR::dct(track_value,m=6,fit=T))

ggplot(sS.dftlong.mean) +
  aes(x = freq, y = smoothed_k0tok6,col=labels) +
  geom_line() +
  ggtitle("Smoothed with 7 DCT-coefficients ()")
```

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

```r
ggplot(sS.dftlong.mean) +
  aes(x = freq, y = smoothed_k0tok5,col=labels) +
  geom_line() +
  ggtitle("Smoothed with 6 DCT-coefficients (m=5)")
```

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

```r
ggplot(sS.dftlong.mean) +
  aes(x = freq, y = smoothed_k0tok4,col=labels) +
  geom_line() +
  ggtitle("Smoothed with 5 DCT-coefficients (m=4)")
```

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

```r
ggplot(sS.dftlong.mean) +
  aes(x = freq, y = smoothed_k0tok3,col=labels) +
  geom_line()  +
  ggtitle("Smoothed with 4 DCT-coefficients (m=3)")
```

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

```r
ggplot(sS.dftlong.mean) +
  aes(x = freq, y = smoothed_k0tok2,col=labels) +
  geom_line()  +
  ggtitle("Smoothed with 3 DCT-coefficients (m=2)")
```

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

```r
ggplot(sS.dftlong.mean) +
  aes(x = freq, y = smoothed_k0tok1,col=labels) +
  geom_line() +
  ggtitle("Smoothed with 2 DCT-coefficients (m=1)")
```

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