Skip to content

Instantly share code, notes, and snippets.

@cryptospectrum
cryptospectrum / spec_var2_01.py
Created March 30, 2013 06:06
Spectrogram Example, Python
from pylab import *
import wave
sig = wave.open('ycn9999 _out.wav','r')
xsig = sig.readframes(-1)
xsig = fromstring(xsig, 'Int16')
f = sig.getframerate()
spectrogram = specgram(xsig[0:300000], Fs = f, scale_by_freq=True,sides='default')
axis('tight')
title('Spectrogram of Sound Synthesis Variant 2, with Python');
@cryptospectrum
cryptospectrum / svd_movie_code_01.m
Created March 14, 2013 01:31
Singular Value Decomposition and Compression of an Image Demo
G=imread('garlic_chive_flowers-color.tif','tif');
%G=imread('Cavolfiore_Di_Sicilia_Violetto.jpg','jpg');
G=double(G);
MG1 = ones(size(G(:,:,1),1),1)*mean(G(:,:,1));
MG2 = ones(size(G(:,:,2),1),1)*mean(G(:,:,2));
MG3 = ones(size(G(:,:,3),1),1)*mean(G(:,:,3));
G1 = G(:,:,1)-MG1;
G2 = G(:,:,2)-MG2;
G3 = G(:,:,3)-MG3;
@cryptospectrum
cryptospectrum / jux_py_1.pyw
Last active December 14, 2015 13:48
JUXTAPROCESS, Running Process Report with Python
from operator import itemgetter
import win32com.client
import time
run_time=time.ctime()
strComputer = "."
objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2")
procItems = objSWbemServices.ExecQuery("Select * from Win32_Process")
plist=[];
pcnt1=0