Copy from GNURadio example