Skip to content

Instantly share code, notes, and snippets.

@hiyuh
hiyuh / cmp_sym.m
Last active February 12, 2019 00:29
function cmp_sym()
N = 20; % NOTE: sym2 to sym20.
M = 2;
b2 = zeros(N, M);
for n = 2:N;
for m = 1:M;
[n, m]
switch (m)
case 1
g = coe_sym(n, 1); % NOTE: LUT from PyWavelets.
@hiyuh
hiyuh / coe_db.cxx
Last active February 12, 2019 08:37
#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <ios>
#include <iomanip>
#include <limits>
#include <numeric>
#include <vector>
#include <boost/math/tools/polynomial.hpp>
diff --git a/wavelets/wfilt_db.m b/wavelets/wfilt_db.m
index 35c3cada..7016739a 100644
--- a/wavelets/wfilt_db.m
+++ b/wavelets/wfilt_db.m
@@ -1,4 +1,4 @@
-function [h, g, a, info] = wfilt_db(N)
+function [h, g, a, info] = wfilt_db(N, coe = 0, compat = 1, dedeg = 0, il = 1)
%WFILT_DB Daubechies FIR filterbank
% Usage: [h,g] = wfilt_db(N);
%
@hiyuh
hiyuh / cmp_db.m
Last active February 8, 2019 09:10
function cmp_db()
N = 38; % NOTE: db1 to db38.
M = 3;
b2 = zeros(N, M);
for n = 1:N;
for m = 1:M;
[n, m]
switch (m)
case 1
g = coe_db(n, 1); % NOTE: LUT from PyWavelets.
@hiyuh
hiyuh / nvc-wrapper.sh
Last active August 29, 2015 13:57
my lazy wrapper script for nvc
#!/bin/sh
guess_prefix() {
if [ -x ./src/nvc ] ;
then
# NOTE: in-tree build, on top build = srouce directly.
echo "." ;
else
if [ -x ../src/nvc ] ;
then
@hiyuh
hiyuh / array4.vhd
Last active August 29, 2015 13:55
simple 3 dimension ROM by using array.
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;
package ROM_3D_PKG is
component ROM_3D is
generic (
Lx : integer range 1 to integer'high := 8;
@hiyuh
hiyuh / tp1.vhd
Created February 3, 2014 10:29
simple generic up counter in two-process method
library ieee;
use ieee.std_logic_1164.all;
package gcnt_pkg is
component gcnt is
generic (
w : integer range 1 to integer'high := 8;
async : boolean := false
);