Sunday, 9 July 2017

Python matplotlib: insets and aligned legends

Sometimes it is needed to create a plot with several lines and to assign a legend to each of them, which quite often ends in cumbersome and clunky legends. In my opinion, a more elegant way is include the legend as aligned text aside to each plot line, which is possible using Python and matplotlib.

Furthermore, to better highlight some details it is also possible to use an inset, hence to add a box which zooms a particular detail of the plot.

In the following is the Python code. The style is optimised for an IEEEtran journal.

Thursday, 9 February 2017

Peer review template based on IEEEtran and pandoc

When you start to be involved in scientific publishing, one of the side-effects is to become a reviewer for some journals. This side-effect is an extremely important part of the scientific publishing process, which should ensure the quality of the published papers. It has also some other advantages, as to be able to view the papers few months before they would be published. The major downside is the time required for a good review, even days.

To simplify the writing process I decided to create a simple workflow which is based on \(\LaTeX\), IEEEtran and pandoc. The final output will be made up of a .pdf file, formatted as an IEEEtran journal, and a .rst file, formatted as a reStructuredText. The .pdf is ideal for viewing the math, figures, etc., while the .rst file is ideal to be pasted in the comments part, which is the part that will be sent in the email to the authors.

International Morse Code

This is a nerdy post, just to share a cheat-sheet which contains the International Morse Code along with the NATO Phonetic alphabet. I created this, using various resources online, just to lose some time…

Wednesday, 8 February 2017

Import a RF design (and logos) from svg, png or Gerber files into Kicad

KiCad is a wonderful software for PCB designing, it is open-source and can handle the complete workflow from the schematic to the final layout.

Unfortunately, it is not (yet) intended for RF circuit and antenna design. In these cases, a suitable program should be used, which could be ADS, CST, HFSS, or others. These are expensive but, unfortunately, the open-source tools are still not complete enough. I generally use multiple open-source tools depending of the requirements and quite often compare the results to evaluate the correctness.

Long story short, I was facing with the need to create a PCB by incorporating some custom Inductive Power Transfer coils, which I could export to a Gerber file from CST and some patch antennas and matching circuits, from ADS. The idea was to import the different parts from the Gerbers into different footprints, which are then assigned to schematics blocks and placed on the PCB.

There are no ways (yet) to get it simply by using some pre-baked functions, but some tricks are needed.

This post is a walk-through different options that can be used. I try to compare the options and outline the strengths of each one.

Notice that the same methods can be used to produce custom logos or any custom shape.

Monday, 9 May 2016

Visually engaging periodic plots using Python

In order to obtain periodic images with a technical feel to be embedded in a website, I decided to compose them with Python and Matplotlib. The plots are essentially some sums and multiplications of "noisy" sines.


Saturday, 20 June 2015

Reduce screen blue light - f.lux and RedShift

Day by day, artificial lights with a huge blue spectrum are becoming more ubiquitous.
By mean of the melatonin mechanism it is said blue light can influence the ability to sleep.
In pre-fluorescent era, the standard was the incandescent bulb: this bulb is known to radiate similarly to a 3500K black body, thus with a low blue component and with a low effect on the melanopsin-containing cells in your retina which reacts to light.
The change to fluorescent and led [and...] lights has changed the paradigm.

Long titles with math in LaTeX

Recently, while writing my dissertation I stumbled upon some difficulties with chapter and section titles.
The first problem was caused by too long headings, while the second by mathematics inside the pdf bookmarks when using hyperref .

Friday, 19 June 2015

Template Tesi e Frontespizio LaTeX UNIBO - Versione 2

Fresco fresco dalla laurea magistrale ho deciso di pubblicare il template che ho utilizzato per preparare la tesi in \( \LaTeX \).

Tuesday, 4 February 2014

Theory of Information - Matlab Code Snippets

That is a collection of some snippets in Octave (Matlab) I created during the course "[TIC] TEORIA DELL'INFORMAZIONE E CODICI LM" for the MS in Electronic and Telecommunication Engineering.
As always, they are open-sourced on GitHub, so any suggestion is welcomed. The best way is by fork & pull.

Appunti del corso "Equazioni Differenziali LM"

Durante il corso di "Equazioni Differenziali LM" nell'ambito del corso di laurea in "Ingegneria Elettronica e Telecomunicazioni per lo Sviluppo Sostenibile" ho scritto una versione \( LaTeX \) degli appunti e delle dispense fornite dal docente Prof. Massimo Cicognani.
Sono disponibili su GitHub.
Nel caso si trovassero errori o typos vari, la cosa migliore sarebbe fare una fork del repository, fare i fix vari e pull request a seguire. Per i meno scaltri, anche aprire una issue potrebbe essere sufficiente e provvederò successivamente io al fix.

Wednesday, 17 July 2013

Markdown - StackEdit's HTML export template with highlighting by using Prettify or Highlight.js and personalized markDown.css

StackEdit is a Markdown Extra editor with MathJax (to display formulas using TeX Math syntax, see HERE if you are interested to show them on Blogger) and Prettify or highlight.js (for code highlighting) support.
It is a wonderful option when it comes to publish some HTML, even with a custom CSS!
Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

Saturday, 13 October 2012

Frontespizio LaTeX UNIBO

In piccolo aiuto a chi dovesse scrivere la tesi; nel caso in cui, come me, vi trovaste in difficoltà nell'ottenere un bel frontespizio, potete provare questo template LaTeX.
Aggiornamento: a questo link ho pubblicato il template LaTeX completo, non solo di frontespizio, che ho usato per la tesi di laurea magistrale. Enjoy!

Friday, 12 October 2012

Dissertation Beamer template

A simple LaTeX Beamer template is shown (I used it for my dissertation's slides):

WAVE (Waves As Virtual Eyes)

WAVE (Waves As Virtual Eyes) is a project developed in 2009 from Alex Pacini, Stefano Pratiffi, Eric Paoloni and Alessandro Renzi.
It consists in a guide belt for blind people.
It won a participation to FAST 2010 in Milan and, successively, to ESE 2010 in Moscow. It also won the CNA/CAR merit, the Intel Excellence in Computer Science Award and the subscription to ANIPLA (Associazione Nazionale Italiana Per L'Automazione).

Wednesday, 11 January 2012

Change MAC address in Sabayon/Gentoo Linux

If, for any reason, you want to change your MAC address in Sabayon/Gentoo Linux, there are two easy way to do it.
Everything is done as root.