2019年12月6日星期五

Several reasons for no output from the laser source

Laser source model: ALPHALAS PLDD-50M

Possible reasons for no laser output:

1. Leakage current:


Summary of commonly used commands for Ubuntu servers

Here I summarize some commands that are commonly used when using an Ubuntu server (GPU server). It is still in the process of continuous improvement.

View graphics card usage

nvidia-smi


View hard disk usage

df -hl # Viewing the remaining disk space df -h # View the partition size of each root path


Launch visdom

python -m wisdom.server

You can add parameters later, such as in port 9099, open in encrypted mode

python -m visdom.server -port 9010 -enable_login


2019年11月30日星期六

Possible causes of no output from SPAD sensor

As the first time I used a SPAD sensor, I didn't get the correct output from my SPAD sensor for two reasons:

Reason 1:


The enable terminal is not connected high level voltage. The SPAD sensor is likely to have an enable terminal. Only when the enable terminal is connected to a high level can data be collected normally.

Reason 2:


The protective head of the SPAD sensor has not been removed. In order to protect the sensor, SPAD sensors usually have a protective cover. Data can only be obtained if the black protective cover is removed.

Summary:


The above reasons are generally explained in the manual. Reading the manual carefully before the first use can avoid many common mistakes.

How to merge videos in batch?

What if we have hundreds of videos and want to merge them into one video in batches without too much trouble?


This can be done in two steps:
1. Create a text file videolist.txt
The contents are as follows:

Simple implementation of audio variable speed without changing pitch



Preparation: ffmpeg needs to be installed

Method: command prompt input

All we need to do is just input:

ffmpeg -n -i input.wav -filter:a "atempo=0.5" output.wav

Where input.wav and output.wav are input files and output files, respectively, and can be other file formats, such as:

ffmpeg -n -i input.m4a -filter:a "atempo=0.5" output.mp3

Among them, 0.5 represents the multiple, and changing to 2 means 2 times speed up.


It can also be processed in batches, such as (Python):

import osimport sys
m4a_path = "./m4a/"  # m4a文件所在文件夹
finish_path = "./finished/"

def run():        m4a_file = os.listdir(m4a_path)        str1 = '-filter:a \"atempo=2\"'        print('m4a')        for i, m4a in enumerate(m4a_file):             os.system("ffmpeg -n -i "+ m4a_path + m4a             + " " +str1 + " "+finish_path + m4a[0:-4] + ".mp3" )
run()


Reference:

https://stackoverflow.com/questions/45441557/how-to-change-speed-of-a-wav-file-while-retaining-the-sampling-frequency-in-pyth/45441708

2019年10月24日星期四

Debug: Latex命令行编译无法显示参考文献

使用如下命令行编译Latex:
@echo off
del egpaper_final.pdf
pdflatex egpaper_final.tex
bibtex egpaper_final.tex
pdflatex egpaper_final.tex
pdflatex egpaper_final.tex
Call clean.bat
start egpaper_final.pdf

发现无法显示参考文献。但使用overleaf却可以正常编译。

2019年10月23日星期三

服务器中安装Matlab for Python

由于训练网络计算损失函数的时候需要进行FFT和稀疏矩阵,使用Python完成非常麻烦,因此希望能够在服务器上安装供Python使用的MATLAB Engine, 但有如下两个问题:
1. 普通MATLAB Engine for Python的安装需要root权限,但我没有;
2. 使用Conda安装了多个环境,如何控制指定环境安装Matlab Engine也是问题。

本文主要解决上述两个问题。