Signals can be any time-varying or space-varying quantity. Examples: speech, temperature readings, seismic data, stock price fluctuations. A signal has one or more frequency components in it and can be viewed from two different standpoints: time-domain and frequency domain. In general, signals are recorded in time-domain but analyzing signals in frequency domain makes the task easier.... Continue Reading →

# Introduction to Genetics Algorithm (GA) (Part 2)

To find a basic introduction of GA, the first part can be found here. III. Examples using Genetics Algorithm In these examples, we will use Matlab and its function ga to apply GA for the optimization problem. For the manual of using this function, you can find it at https://www.mathworks.com/help/gads/ga.html or type in Matlab: help ga... Continue Reading →

# Introduction to Genetics Algorithm (GA) (Part 1)

I. Introduction In daily life as well as in doing research, we might come to problems that require a lowest/highest value of variables, e.g.: find the shortest way from home to work, buying household items with a fixed amount of money, etc. These problems could be called "optimization" and today we will introduce an algorithm to... Continue Reading →

# Best-fit quadratic surface from given points in 3D using Matlab

In Earth Science research, sometimes we need to construct 3D surfaces from given points, for example: creating the fault surface, locating a subducting slab from earthquake hypocenters, etc. in a region of interest in X-Y plane. In this example, we will show how to create a best-fit quadratic surface from given points in 3D using... Continue Reading →

# Locating Earthquake using Geiger’s Method

Earthquake location problem is old, however, it is still quite relevant. The problem can be stated as to determine the hypocenter (x0,y0,z0) and origin time (t0) of the rupture of fault on the basis of arrival time data of P and S waves. Here, we have considered hypocenter in the cartesian coordinate system. It can... Continue Reading →

# Some utilities to deal with sac data format

In seismology, we usually have to deal with the sac data format (binary data format). This data format can be dealt easily and efficiently with the SAC software provided by IRIS. But if we want to use this data in other software for instance MATLAB, then we may need to convert the data in alphanumeric... Continue Reading →

# Statistical Analysis in MATLAB

Doing statistical analysis in MATLAB is lot easier than other computer languages. Here, we can make use of the intrinsic "plot" to visualize the statistics of the data. Below are some programs for commonly used statistical analysis: Calculating mean, standard deviation, median etc of the data and visualizing the data using the histograms. Here, we... Continue Reading →

# Reading Complex Text Data (MATLAB)

Text data which is in one format all through the file is easier to read. But when the text data has numeric entries, string entries (different data formats), then it becomes little complicated to read and write. Sometimes, the data is also not arranged in regular rows and columns form which makes them even more... Continue Reading →

# Using a Function (MATLAB)

If we need to run the same algorithms or formula for computations again and again, then instead of writing the same stuffs in our script file many times, we can simply write a function. This makes our script look simpler and faster to run. Writing a function in MATLAB Examples: Calculating mean and standard deviation... Continue Reading →