enter image description here

How to draw this signal especially sawtooth using foreach. Square wave is clock signal can be drawn using tikztimingtable package. Is there any other better way to draw these signals in circuitikz? Commands for clock signal

    timing/slope=0,         % no slope
    timing/coldist=2pt,     % column distance
    xscale=4,yscale=4, % scale diagrams
    semithick               % set line width
 % \scriptsize
M$_N$   &  10{2C} G \\

From the tikz-timing manual it doesn't look like the package supports non-square waves.

Below is an example of how to draw such a thing in plain tikz using \foreach as you ask. The same would probably work in circuitikz as well.

\documentclass[tikz, border=3pt]{standalone}
  \draw[help lines] (0,0) grid (7,2);
  \draw[thick] (0,1) node[anchor=base east] {$\mathsf{M}_N$} -- ++(1,0)
    \foreach \x in {1,...,3}{
    -- +(0,.5) -- +(1,.5) -- +(1,0) -- ++(2,0)
    } -- +(0,.5);
  \draw[thick] (0,0) node[anchor=base east] {$S$} -- ++(1,0)
    \foreach \x in {1,...,3}{
    -- +(1,.5) -- +(1.2,0) -- ++(2,0)


Hopefully it's not too hard to see how to extend this to other wave shapes and larger tables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.