# Publications

# Dealing with plotting negative, zero and positive values in log scale

Sometimes you have to show positive, zero and negative number in log scale. However you cannot take log of negative numbers and zero. But one could approximate it with a log transform modulus as stated here. In Python with numpy: from numpy import sign, abs, log10 import matplotlib.pyplot as plt # Data varies in several Read More …

# Python code for generating plasmonic metal dielectric functions

I keep needing a python code to generate the dielectric functions of plasmonic materials such as Au, Ag, Pd, and Pt. I wanted the dielectric functions called by other python codes such as TMM. So I wrote a python version of LD.m LD.m is a matlab file written by Bora Ung that produces dielectric functions Read More …

# DDSCAT on amazon EC2

Amazon provides high performance computing capabilities through their EC2 service. You can find more information here They provide a 750 hr free instance with their a free-tier program. If you want more resources, you can pay for it. See the pricing, pricing seem very reasonable. I wanted to see how easy it was to install Read More …

# Doorbell with NRF24L01 and Arduino

My current apartment does not have a doorbell (Its strange but it is true). I went ahead and built a doorbell using two arduino pro-minis and two NRF24L01 transceivers. The melody to be played when a guest presses a button is controlled by me. I have four melodies programmed in. Here it is in full Read More …

# Airtel tune on arduino

For my doorbell project, I needed some melodies to be played on arduino. One can takes notes of a melody and write a corresponding arduino code. I like airtel tune and wanted to play it with arduino. I got the notes from https://www.youtube.com/watch?v=3m5j5UIRqQc Here is the final result, where I use it in my doorbell project. Read More …

# Controlling Rigol Dp832 with python

DC power supplies are very handy for electronic projects. They help to apply bias to a devicve. Controlling it by a computer by a program is helpful in advanced projects where timing and accurate control is an issue. I got my hands on a RIGOL DP832 which is three channel (two 30V and one 5V) Read More …

# DIY Audio cables using CAT5

Inspired by the article on speaker cables, I built the CAT5 V3 version of the speaker cable. Following are the images of how I made them. I have access to a precise LCR meter and will measure R, L and C as function of frequencies shortly. The capacitance of the cat5 speaker cables is known to Read More …

# Electric field at localized plasmon resonance using MEEP

This article is about simulating localized plasmon resonances in metal nanospheres using MEEP package. Generally, I am interested in solving three problems in LSPR systems: Calculate the extinction, scattering, absorption spectra of metal nanoparticle The procedure for doing this is very similar to the method I mentioned here. Calculating the electric field enhancement spatially as Read More …

# van der Pauw correction factor

The van der Pauw Method is a technique commonly used to measure the Resistivity and the Hall Coefficient of a sample. A correction factor goes into calculating the resistivity as described in van der Pauw paper. A iterative method is generally used to calculate the correction factor and this correction factor is plotted in Figure Read More …

# All entries of array except certain indices in octave/matlab

In Octave or Matlab, some times one needs to eliminate certain elements in an array. For example, if a=[10,20,30,40,50,60]; and suppose I want to create a matrix “b” such that it has all the elements of “a” except 20 and 40. This can be achieved by: b=a(1:end~=2&1:end~=4); The result is: b = 10 Read More …