Función con un arco

Función con un arco

Estoy intentando recrear este gráfico.

ingrese la descripción de la imagen aquí

Sé que mi método es arcaico y algo incorrecto. Me pregunto si hay una mejor manera de replicar lo representado anteriormente functionsin tener que dibujarlo casi manualmente como lo estoy haciendo actualmente curve through points.

La explicación:

La función no está definida con una fórmula, pero representa la distancia entre la amplitud de una señal y lo que se llama el ruido de fondo (ruido con amplitud constante) de la salida de un convertidor analógico a digital. A medida que la amplitud de la señal crece, se aleja linealmente del ruido. De ahí la primera parte de la función. Pero luego su crecimiento deja de ser lineal, luego alcanza su pico, seguido de la saturación del convertidor analógico a digital y una disminución abrupta en la distancia entre la amplitud de la señal y el piso de ruido.

Aquí está mi intento con este MWE:

\documentclass{memoir}
\usepackage{tikz,pgfplots}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{shapes,snakes}
\usetikzlibrary{patterns,hobby}

\begin{document}
\begin{figure}[htbp]
    \centering
    \begin{tikzpicture}
        \draw[-{Latex[length=2.5mm, width=1.5mm]}] (0,0)--(6,0) node[anchor=north]{};
        \draw[-{Latex[length=2.5mm, width=1.5mm]}] (0,0)--(0,6) node[anchor=east]{};
        \node[anchor=south, rotate=90] at (-0.5,3) {$SNR,~SNDR~[dB]$};
        \node[anchor=north] at (3,-0.5) {$Input~Signal~Amplitude~[dBv]$};
        \node[anchor=north east] at (0,0) {0};

        \draw (0,0) -- (4,4);
        \draw (4,4) to [curve through ={(4.2,4) . . (4.5,3.6)}] (5,2);% curve
    \end{tikzpicture}
    \caption{Performance metrics.}
\end{figure}
\end{document}

Resultado:

ingrese la descripción de la imagen aquí

Respuesta1

Puedes simplemente trazar funciones. Si proporciona más información sobre el origen de esta trama, encontraré una función mejor. Lo que estoy haciendo aquí es trazar un arco elíptico. Estoy usando funciones para esto, pero igualmente podrías usar elarc sintaxis proporcionada por Ti.kZ. La razón de los arcos elípticos es que sus funciones parecen volverse verticales en x_max/2. Y la razón para dibujar funciones es que sospecho que tienes una teoría detrás de estos gráficos y, en última instancia, alimentarás el argumento con funciones reales. (Y supongo que no tiene dificultades para dibujar las características adicionales).

\documentclass{memoir}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,calc,intersections}

\begin{document}
I guess that has now become more a mathematics problem. Let's assume you really
want a function that starts off at $(x_1,y_1)$ somewhere with slope 1 and then
has slope $-\infty$ at some other place. This defines an elliptical arc, which
can be parametrized by
\[ \gamma(\varphi)~=~\left(\begin{array}{c}
 x_0+a\,\cos(\varphi)\\ b\,\sin(\varphi)
\end{array}\right)\;.\]
Here, we have set a possible shift in $y$ direction to 0 since we want the slope
to become infinite when the curve hits the $x$--axis.
What is the angle at which the slope is 1? The slope is given by the ratio of
the derivatives of the coordinates, such that
\[ -\frac{b\,\cos(\varphi_1)}{a\,\sin(\varphi_1)}~\stackrel{!}{=}~1
\quad\curvearrowright\quad \varphi_1~=~-\arctan\left(\frac{b}{a}\right)\;.
\]
Now we want at the same time that
\[ \gamma(\varphi)~=~\left(\begin{array}{c}
 x_0+a\,\cos(\varphi_1)\\ b\,\sin(\varphi_1)
\end{array}\right)~=~
\left(\begin{array}{c}
x_0-\frac{1}{\sqrt{1+b^2/a^2}}\\
\frac{b/a}{\sqrt{1+b^2/a^2}}
\end{array}\right)
~\stackrel{!}{=}~
\left(\begin{array}{c}x_1\\ y_1\end{array}\right)\;.\]
This means that we can only adjust one parameter, say $b$, and the other
parameters are then fixed by
\[
 a^2~=~\frac{b}{y_1}\,\sqrt{b^2-y_1^2}\quad\text{and}\quad
 x_0~=~x_1-y_1+\frac{b^2}{y_1}\;.
\]
\begin{figure}[htbp]
    \centering
    \begin{tikzpicture}
        \draw[-{Latex[length=2.5mm, width=1.5mm]}] (0,0)--(6,0) node[anchor=north]{};
        \draw[-{Latex[length=2.5mm, width=1.5mm]}] (0,0)--(0,6) node[anchor=east]{};
        \node[anchor=south, rotate=90] at (-0.5,3) {SNR,~SNDR~[dB]};
        \node[anchor=north] at (3,-0.5) {Input~Signal~Amplitude~[dBv]};
        \node[anchor=north east] at (0,0) {0};

        \draw (0,0) -- (4,4);
        % in these examples I have set x_1 = y_1 = 4
        \def\xOne{4}
        \def\b{4.15}
        \pgfmathsetmacro{\a}{\b*sqrt((\b^2-\xOne^2))/4}
        \draw[name path=upper plot] plot[variable=\x,domain=180-atan(\b/\a):0,samples=50] 
        ({\xOne-(\xOne-\b^2/\xOne)+\a*cos(\x)},{\b*sin(\x)});
        \coordinate (max1) at({\xOne-(\xOne-\b^2/\xOne)+\a*cos(90)},{\b*sin(90)});
        \def\b{3.9}
        \def\xOne{3.7}
        \pgfmathsetmacro{\a}{\b*sqrt((\b^2-\xOne^2))/\xOne}
        \draw[dashed,name path=lower plot] plot[variable=\x,domain=180-atan(\b/\a):0,samples=50] 
        ({\xOne-(\xOne-\b^2/\xOne)+\a*cos(\x)},{\b*sin(\x)});
        \coordinate (max2) at
        ({\xOne-(\xOne-\b^2/\xOne)+\a*cos(90)},{\b*sin(90)});
        \coordinate (O) at (0,0);
        \draw[dotted] (O|-max1) -- (max1) node[above,pos=0.7]{SNR$_\mathrm{peak}$} --(O-|max1);
        \path [name path=horizontal 2] (max2) -- ++(2cm,0);
        \draw [dotted,name intersections={of=upper plot and horizontal 2, by={a0}}]
         (a0) -- ++(-2cm,0) node[left]{SNDR$_\mathrm{peak}$};
    \end{tikzpicture}
    \caption{Performance metrics.}
\end{figure}
\end{document}

ingrese la descripción de la imagen aquí Puede ajustar un parámetro, \b, para controlar el arco. Y es sencillo leer el máximo y así sucesivamente, y puedes usar TikZ para hacer todo tipo de cosas con él, como se ilustra.

información relacionada