<p>The plot shows the differences between a <a href="https://en.wikipedia.org/wiki/DFT" class="extiw" title="w:DFT">DFT</a> and a <a href="https://en.wikipedia.org/wiki/DCT" class="extiw" title="w:DCT">DCT</a> of a generic signal.
</p><p>The first plot is a sampled ramp in the time domain. The second one represents the modulus of its DFT. The third one the plot of its DCT.
</p><p>I obtained it in a two step process. First I ran the following <a href="https://en.wikipedia.org/wiki/Matlab" class="extiw" title="w:Matlab">Matlab</a> code:
</p>
<pre>

</pre>
<p>thus creating a file called example_dft_dct.dat. Then I ran the following <a href="https://en.wikipedia.org/wiki/Gnuplot" class="extiw" title="w:Gnuplot">Gnuplot</a> code:
</p>
<pre>

</pre>
<a href="//commons.wikimedia.org/wiki/User:Alejo2083" title="User:Alejo2083">Alessio Damato</a>
CC BY-SA 3.0
<span class="int-own-work" lang="en">Own work</span>