I need a color gradient to follow a sum function in both the vertical and horizontal direction. In the figure only the horizontal sum function (the bottom line in the figure) is shown. What I need is a color gradient that follows the path coming from the MMF (The red colored trapez coming from the MMF rectangle).
Any help will be highly appreciated
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\newcommand\XOBJ{3}
\newcommand\YOBJ{10}
\newcommand\scale{0.3}
\path[use as bounding box] (0,-1) rectangle (11.5,12);
\node (rect) at (\XOBJ,\YOBJ) (OBJ) [draw,thick,minimum width=1.7cm,minimum height=1cm] {OBJ};
\node (MMF) [rectangle, draw,thick,xshift = 2.5cm,minimum width=2.5cm,minimum height=0.5cm,right of = OBJ] {MMF};
\filldraw [red,opacity=0.2] ([yshift=-2pt]OBJ.north east) --([yshift=2pt]OBJ.south east) -- ([yshift=2pt]MMF.south west) -- ([yshift=-2pt]MMF.north west) -- ([yshift=-2pt]OBJ.north east);
\filldraw [red,opacity=0.2] ([yshift=2pt]MMF.south east) -- ([yshift=-2pt]MMF.north east) -- (10,11) -- (10,9) -- ([yshift=2pt]MMF.south east);
\node (N1) [circle,draw, right of = MMF,xshift = 1.2cm,yshift = 0.2cm ] {};
\node (N2) [circle,draw, right of = N1,yshift = 0.1cm,xshift = 0.01] {};
\node (N3) [circle,draw, below right = 0.1 cm and 0.255cm of N1 ] {};
\node (N5) [circle,draw, below right = -0.7cm and -0.2cm of N1 ] {};
\node (N6) [circle,draw, below right = 0.6cm and -0.2cm of N1 ] {};
\node (N7) [circle,draw, below right = 0.6cm and 0.7cm of N1 ] {};
\draw[scale=0.5,domain=-1:4,smooth,variable=\x,red] plot ({\x+17},{\scale*sin(deg(\x+4))+17}) node[anchor=east,xshift = -2.5cm ] {Wave 1};
\draw[scale=0.5,domain=-1:4,smooth,variable=\x,red] plot ({\x+17},{\scale*cos(deg(2*\x+3))+15.5}) node[anchor=east,xshift = -2.5cm ] {Wave 2};
\draw[scale=0.5,domain=-1:4,smooth,variable=\x,red] plot ({\x+17},{\scale*cos(deg(3*\x))+14}) node[anchor=east,xshift = -2.5cm ] {Wave 3};
\draw[scale=0.5,domain=-1:4,smooth,variable=\x,red] plot ({\x+17},{\scale*sin(deg(\x+4))+\scale*cos(deg(2*\x+3)) + \scale*cos(deg(3*\x)) +12}) node[anchor=east,xshift = -2.5cm ] {Sum};
\end{tikzpicture}
\end{document}