Segmentation fault
There is an error on line 50: [Hp, Gp] = wfilters (wname, "d"); This should be: [Hp, Gp] = wfilters (wname, "r");