This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static string RemoveWordsAtIndices(string theString, int[] indices) | |
{ | |
Array.Sort(indices); | |
int originalWordCount; | |
int newWordCount; | |
int numberOfWordsToRemove; | |
string[] originalWordArray; | |
string[] newWordArray; | |
originalWordArray = theString.Trim().Split(' '); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Complex transforms | |
# Sign argument | |
# -1 = Complex to Complex reverse FFT | |
# 1 = Complex to Complex forward FFT | |
# ffts_plan_t *ffts_init_1d(size_t N, int sign); | |
# Create a plan for a forward 1D FFT of size 16 | |
N = 2^16 | |
Direction = 1 | |
ffts_plan = ccall((:ffts_init_1d, "libffts"), Ptr{Void}, (Csize_t, Cint), N, Direction) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#==============================================================================# | |
# Kaiser Filter # | |
#==============================================================================# | |
fc = 0.15 # filter cutoff frequency | |
ft = 0.05 # filter transition | |
As = 60.0 # stop-band attenuation [dB] | |
mu = 0.0 # fractional timing offset | |
# estimate required filter length and generate filter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Radio | |
using Winston | |
import DSP: welch_pgram | |
symbols = pskmod( 100000, 4, 4 ) | |
noise = wgn(length(symbols), 5, "dBm", 50, true) | |
signal = symbols .+ noise | |
spectrum = welch_pgram( signal, 100, 50 ) | |
spectrum = fftshift( spectrum ) | |
spectrum = 10*log10( spectrum ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# function czt( x::Vector ) | |
x = ones(8) | |
N = length( x ) | |
M = nextpow2( 2*N - 1 ) | |
xx = zeros( Complex128, M ) | |
yy = zeros( Complex128, M ) | |
for n = 1:N | |
xx[n] = x[n] | |
yy[n] = exp( im * π/N * (n-1)^2 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String ipAddressPattern = Patterns.IP_ADDRESS.toString(); | |
if (theAddress.matches( ipAddressPattern )) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ippLibPath = "/opt/intel/composer_xe_2013_sp1.3.166/ipp/lib" | |
originalFolder = pwd() | |
cd( ippLibPath ) | |
function fix_ipp_dylib( dylibFileName, path ) | |
correct_id = joinpath( ippLibPath, dylibFileName ) # we want all the dylib ID's to have the full path | |
cmd_get_id = `otool -DX $dylibFileName` # Get the dylib's ID (we want it to be path+filename) | |
cmd_set_id = `install_name_tool -id $correct_id $dylibFileName` | |
results = readlines( cmd_get_id ) | |
original_id = strip( results[1] ) # The first line is a header, the second is the dylib's ID |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import IPPDSP | |
function polyize{T}( h::Vector{T}, interpolation ) | |
hLen = length( h ) | |
tapsPerPhase = int( ceil( hLen/interpolation )) | |
pfbSize = tapsPerPhase * interpolation | |
# check that the vector is an integer multiple of interpolation | |
if hLen != pfbSize | |
hExtended = similar( h, pfbSize ) | |
hExtended[1:hLen] = h |
OlderNewer