DSPRelated.com
Forums

How to create a vector graphic of a block model

Started by Lucky_12 7 years ago9 replieslatest reply 7 years ago1024 views

Ok, this is not a question related to digital signal processing. Sorry about that. Maybe you can still help: 

I want to create the following three graphics myself: 


bildschirmfoto vom 2017-01-30 13:44:21_4

intermodulation_products_246.gif

I really want to have the exact same graphics. I want to create them myself, because the quality of these is not very good (except maybe the last one). I have tried to draw the block diagram with inkscape. But it doesn't look very professional. I was thinking, maybe there is a way to create them using Simulink? But so far I couldn't figure it out.

[ - ]
Reply by jms_nhFebruary 6, 2017

Good question, and it doesn't have a great answer.

If you want easy, use something like Inkscape or yEd or (gasp) Visio.

If you want professional-looking, my software tool of choice is TikZ, a set of graphics libraries for the TeX typesetting package.

Here's an example of a block diagram in TikZ:

http://www.texample.net/tikz/examples/noise-shaper...

Unfortunately to get good results there's a bit of a learning curve and it's really not user-friendly. But that's what I use for all the block diagrams in my blog articles.

[ - ]
Reply by JOSFebruary 6, 2017

Yes, tikz is the gold standard.  I use xfig myself.

[ - ]
Reply by Lucky_12February 6, 2017
allright, thanks! I will consider using TikZ, but since it's kind of urgent, I will probably stick with Visio then.
[ - ]
Reply by Lucky_12February 6, 2017
hey,


thanks for your answer! I have tried out both LibreOffice Impress and Inkscape. I have exported my Inkscape drawing as an .eps file. I have exported the LibreOffice Impress drawing as .eps and as .png. Please have a look at the results! I am not content with any of it, because the quality is not good and I don't understand why. The .eps files should be a vector graphic. So I expect the quality to be good. For some reason the .eps file exported from LibreOffice Impress does not have colour. 

compare_figures.pdf

[ - ]
Reply by jms_nhFebruary 6, 2017

Try exporting your image to PDF and then use imagemagick to convert from PDF to .png

Yes, it's silly that you have to do something like that, but you will most likely get better results.

[ - ]
Reply by Lucky_12February 6, 2017
allright, thanks so much!
[ - ]
Reply by 5igna1February 6, 2017

Drawing capabilities of Office programs like MS Word or Open/LibreOffice are mainly irritating. Visio isn't free and not perfect at all. TeX graph for me means a text based drawing (process) that is not rapid for starting nor for drawing. ASCII lines are faster;) 

Anyway understanding that WYSIWYG is contrary to TeX does anybody know more "graphical" way of making TeX drawings?

Finally I ended with yEd and then Draw.io

Draw.io has a nice feature - exported PNG integrates XML (source) for future editing - an xml portion occupies minor part of resulting file:

draw.io.block_diagram_22426.png

Update: 

Unfortunately, yEd and Draw.io both miss one important feature that is required to reproduce given graphics. Mathematical accents over characters like tilde, hat, arrow etc. can not be added by these applications without pain. At least I don't know how.

[ - ]
Reply by 5igna1February 6, 2017

Update: 

Draw.io actually has Extras->Mathematical Typesetting feature. It uses MathJax render engine and all looks great except it is available only using online version of Draw.io. That is why I did not see it earlier - I use Draw.io Chrome Desktop version.

[ - ]
Reply by Y(J)SFebruary 6, 2017

When writing my DSP textbook I created a language that I called flow, which compiled to TeX. It only handled drawing DSP flow graphs, but vastly simplified that endeavor. In the flow language you could define points (which represented signals, and to which you could assign a TeX-syntax name string), flow lines (which were drawn as arrows with optional TeX string near the arrow), delays (circles with z^-1 in them), adders (with optional minus signs near specified inputs), and boxes (once again with a TeX-syntax string). I no longer remember the entire feature set. BTW, the arrows were always in the middle of the line, not at the end as in your examples (making it easy to label them with gains).

The language required pinning a few of the points, but knew how to automatically connect them when told to do so (either by an assignment - i.e., a plain arrow, or by a gain - i.e., an arrow with a symbol next to it). The compiler had some logic, for example to put the string to the left or right or above or below points or arrows (strings were always centered inside boxes). The makefile for the entire book compiled all the flow files before TeXing the master TeX file.

Unfortunately, I stopped maintaining this tool years ago, and no longer have a working version. Maybe someone will be sufficiently motivated to create a similar tool and open source it.

Y(J)S