Labels

Tuesday, December 11, 2018

Power spectrum

*MAINLY COPY FROM WIKI

 

Energy spectral density

Fourier transform
\[F[x(t)]  = \int_{-\infty}^{\infty} x(t)\exp(-i 2\pi f t) dt \]
inverse transform
\[ x(t) = \int_{-\infty}^{\infty} F[x(t)] \exp(i 2\pi f t) df \]

Energy spectral density describes how the energy of a signal or a time series is distributed with frequency. The term energy is used in the generalized sense of signal processing, that is, the energy E of a singal $x(t)$ is
 \begin{equation}\label{eq:1}
 E = \int_{-\infty}^{\infty} |x(t)|^2 dt.
\end{equation}

The energy spectral density is most suitable for signal with a finite total energy.

\[\int_{-\infty}^{\infty} |x(t)|^2 dt = \int_{-\infty}^{\infty} |\hat{x}(f)|^2 df, \]
where
\[ \hat{x}(f) = \int_{-\infty}^{\infty} \exp(-iwt) x(t) dt ,\]
is the Fourier transform of the signal and $w = 2\pi f$ is angular frequency.

Since the  integrate on the right-hand side is the energy of the signal (see eq 1), the integrand $|\hat{x}(f)|^2$ can be interpreted as a density function describing the energy per unit frequency contained in the signal at the frequency $f$.

The energy spectral density of a signal $x(t)$ is defined as
\[S_{xx}(f) = |\hat{x}(f)|^2. \]

The definition to a discrete signal with an infinite number of values $x_n$ such as a signal sampled at discrete times $x_n = x(n \Delta t)$:
\[S_{xx}(f) = | \sum_{n=1}^{N}\exp(-iw n\Delta t) x_n  \Delta t|^2 \]


Tuesday, November 6, 2018

Deal with file by C++

#include<fstream>

fstream wf("out.dat",ios::out | ios::trunc);
// fstream ofs; ofs.open("out.dat", ios::out | ios::trunc);

Sunday, November 4, 2018

Delay the program some time with C++

#include <chrono> 
#include <thread> 

int main(){
using namespace std::this_thread; /*sleep_for, sleep_until */
using namespace std::chrono; /* nanoseconds, system_clock, seconds */
sleep_for(nanoseconds(10)); 
//sleep_until(system_clock::now() + seconds(1)); 
}  
REFERENCE:
https://stackoverflow.com/questions/158585/how-do-you-add-a-timed-delay-to-a-c-program

Wednesday, October 31, 2018

Powerful string processor with c++

/*MYSTR.h*/
 #ifndef _mystr_
 #define _mystr_
 #include<string>
 #include<dirent.h>
 #include<vector>
 
 /* strim remove space from front/end of string */
 /* sreduce remove all redundancy space */
 /* sremove_spaces remove all of space in string */
 std::string strim(const std::string& str, const std::string& whitespace = " \t");
 std::string sreduce(const std::string& str,const std::string& fill = " ",const std::string& whitespace = " \t");
 std::string inline sremove_spaces(std::string str);
 std::vector lisidir(const char *path);
 #endif

Strengthen the matrix in Gun Scientific Library (GSL)

/* MYMATRIX.h */

 #include <stdio.h>
 #include <string.h>
 #include <vector>
 #include <assert.h>
 #include <gsl/gsl_linalg.h>
 #include <gsl/gsl_matrix.h>
 /* arbitrary maximum size */
 #define MAXSIZE 5000*10000 

 void print_matrix( const gsl_matrix *,const char *);
 void fprint_matrix( const char *filename, const gsl_matrix *m, const char *comment ="");
 gsl_matrix * fread_matrix( const char *filen, int *rows, int *clos, int transpose);
 gsl_matrix * vector2matrix(const std::vector<double> x,const std::vector<double>y);

Thursday, October 25, 2018

Resource tools

online math editor
https://www.mathcha.io


Harvard Fairbank Center for Chinese Studies
https://soundcloud.com/fairbank-center


Digital tools for researchers
Code Ocean is a research collaboration platform that provides researchers and developers an easy way to create, collaborate on, share, discover, and run code for private projects and to be published in academic journals and conferences.
Writefull is an app that gives feedback on your writing by checking your text against databases of correct language.


Second-Order Linear Differential Equations
https://www.stewartcalculus.com/data/CALCULUS%20Concepts%20and%20Contexts/upfiles/3c3-2ndOrderLinearEqns_Stu.pdf
http://tutorial.math.lamar.edu/Classes/DE/NonhomogeneousDE.aspx


Repl.it is a development environment that gives you an instant IDE to learn, build, collaborate, and host all on one platform.


Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud.
With Colaboratory you can write and execute code, save and share your analyses, and access powerful computing resources, all for free from your browser.


online pdf editor
https://online.sodapdf.com/#/home?r=view

itermplot
An awesome iTerm2 backend for Matplotlib, so you can plot directly in your terminal.

https://iris.ai/
Speed up literature review

Arxiv Sanity
Web interface for browsing, search and filtering recent arxiv submissions

tool collection
http://tools.kausalflow.com/

Fighting Internet Censorship in a Mass!


is a remote terminal application that supports intermittent connectivity, allows roaming, and provides speculative local echo and line editing of user keystrokes.

MATHS WITH PYTHON 3: DIFFUSION EQUATION

ping.pe

numerical solve differential eqn


Introduction to Scientific Python programming


Assimulo is a simulation package for solving ordinary differential equations. It is written in the high-level programming language Python and combines a variety of different solvers written in FORTRAN, C and even Python via a common high-level interface

Comparing measures of similarity between curves


http://bbs.vicl.net/forum-44-1.html

https://1lib.us/

https://delta.chat/en/  chat with mails

国际JCI认证的医院


opensource grammar check


watch movie online


GIZMO, PIERNIK, Athena++, stochastic-parker