scipy.signal.spectrogram compared to matplotlib.pyplot.specgram

The following code generates a spectrogram using either scipy.signal.spectrogram or matplotlib.pyplot.specgram. The color contrast of the specgram function is, however, rather low. Is there a way to increase it? Using matplotlib.pyplot.specgram gives the following result: Using scipy.signal.spectrogram gives the following plot Both functions seem to use the ‘jet’ colormap. I would also be generally interested in the difference between the two functions. Although they … Read more

A tool to convert MATLAB code to Python

There are several tools for converting Matlab to Python code. The only one that’s seen recent activity (last commit from June 2018) is Small Matlab to Python compiler (also developed here: SMOP@chiselapp). Other options include: LiberMate: translate from Matlab to Python and SciPy (Requires Python 2, last update 4 years ago). OMPC: Matlab to Python (a bit outdated). Mat2py: Matlab … Read more

Differences between Octave and MATLAB

Rather than provide you with a complete list of differences, I’ll give you my view on the matter. If you read carefully the wiki page you provide, you’ll often see sentences like “Octave supports both, while MATLAB requires the first” etc. This shows that Octave’s developers try to make Octave syntax “superior” to MATLAB’s. This attitude makes … Read more

What does operator “dot” (.) mean?

The dot itself is not an operator, .^ is. The .^ is a pointwise¹ (i.e. element-wise) power, as .* is the pointwise product. .^ Array power. A.^B is the matrix with elements A(i,j) to the B(i,j) power. The sizes of A and B must be the same or be compatible. C.f. “Array vs. Matrix Operations”: … Read more

What is the operator `.*` doing in matlab?

It does element-by-element multiplication. Quoting Matlab help (or see online help): .* Array multiply.X.*Y denotes element-by-element multiplication. X and Y must have the same dimensions unless one is a scalar. A scalar can be multiplied into anything. For more information see @am304’s link above.