14 September 2016

Transposing vectors of complex numbers in Matlab

Careful when applying the transpose (apostophe) operator to a vector of complex numbers. See here:

You have to use .' (dot transpose)
If you use the tranpose operator on a complex-valued vector, matrix in MATLAB, it returns the conjugate transpose by default.


01 September 2016

Correlation vs Convolution

This is a basic relationship in DSP.

When we talk about similarity between signals, we normally talk about "correlation".
When we talk about filtering, in the time domain that's a "convolution".

Correlation and convolution are basically the same thing.
The only difference is that correlation is a convolution by the inverted (or flipped) version of the same signal in the time domain:

y(n) = h(n)*x(n) --> convolution
y(n)=h(n)*x(-n) -> correlation

In Matlab/Octave that would be:

y = conv( h, x) for convolution

or

y = conv( h, flip(x)) for correlation.

In the frequency domain, the operation of flipping in the time domain translates into the "conjugate" version of the transform, that is with an inverted sign for its imaginary part.


02 August 2016

Fix for FR_NO_FILESYSTEM error with the embedded FatFS file system

FatFs is a popular file system for embedded applications.
Occasionally though I was having trouble accessing some SD cards, a problem that's been reported here.and here.
I've looked at a working SD card and a not working one.
They were different models and size but the problem came down to the second card not having its logical partition defined as primary. Using Minitool Partition Wizard you can fix this by doing:

1. Right Click on First Partition
2. Select Set Partition as Primary
2. Click on Apply Changes

The partition goes from Logical to Primary.

FAT32 also works, I've tried up to 8GB.