Skip to content

Instantly share code, notes, and snippets.

@unalfaruk
unalfaruk / alfresco-global.properties
Last active April 12, 2020 14:14
Active directory integration configuration for Alfresco Community 5.1 (with comments line by line)
View alfresco-global.properties
###############################
## Common Alfresco Properties #
###############################
dir.root=/opt/alfresco-community/alf_data
alfresco.context=alfresco
alfresco.host=127.0.0.1
alfresco.port=8080
alfresco.protocol=http
View isKaprekarNumber.m
function result = isKaprekarNumber(number)
result=0;
lenOfNumber = length(num2str(number));
numberArray = num2str(number);
sqOfNumber = number.^2;
sqNumberArray = num2str(sqOfNumber);
sqHead= sqNumberArray(1:lenOfNumber);
View isFactorionNumber.m
function result = isFactorionNumber(number)
result=0;
numberArray = num2str(number);
sum=0;
for i=1:1:length(numberArray)
sum=sum+factorial(str2num(numberArray(i)));
end
if isequal(number,sum)
result=1;
end
View chapter_4_1_mod_types.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sending binary data via sinusoidal signal manipulation
% Parameters
sig_len = 1000; % Signal length (in samples)
sampl_per_bin = 100; % Samples per binary representation
bin_data_len = sig_len/sampl_per_bin; %length of binary stream is a multiple of signal length
bin_data = round(rand(1,bin_data_len));
sig_carrier_base = sin(2*pi*(0:(1/sampl_per_bin):(1-(1/sampl_per_bin)))); % Baseline carrier
View chapter_4_1_1_src_encoding.m
% Define parameters
len = 10000; % Length of binary data stream
% Have two binary sources, one 50/50 and the other 90/10 in terms of ones
% and zeros
bin1 = round(rand(1,len)); % 50/50 binary
bin2 = round(0.5*rand(1,len)+0.45); %90/10 binary
% Encode strings of ones in terms of the length of these strings
enc_bin1 = [];
View chapter_4_1_2_ch_encoding.m
% Define parameters
len = 100000; % Length of original binary data stream
N1 = 3; % First repetition factor; should be odd to avoid tie
N2 = 5; % Second repetition factor; should be odd to avoid tie
N3 = 7; % Third repetition factor; should be odd to avoid tie
% Generate binary data stream
bin_str = round(rand(1,len));
% Employ repetition code with repetition factors N1, N2, N3
View chapter_4_QAM.m
% Decoding QAM waveform using I/Q receiver
% Define parameters
N_samp = 1000; % Number of samples per symbol
N_symb = 10; % Number of symbols in transmission
cfreq = 1/10; % Carrier frequency of cosine and sine carriers
% Generate inphase and quadrature channels with 2-PAM waveforms
chI = 2*round(rand(1,N_symb))-1;
chQ = 2*round(rand(1,N_symb))-1;
View chapter4_Comp_Mod_Types_Noise.m
% Generating 4-level pulse amplitude modulation, quadrature amplitude modulation,
% and quadrature phase shift keying waveforms
% Define parameters
len = 10000; % Length of binary string
nvar = 0.15; % Noise variance
% Generate the random bit streams that have already been demultiplexed from
% a single high speed data stream
bin_str1 = round(rand(1,len)); % Inphase data stream
@unalfaruk
unalfaruk / interpolation_example.py
Created February 4, 2022 12:22
It is an example of "interpolation" in Python using NumPy.
View interpolation_example.py
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 4 15:20:49 2022
@author: unalf
"""
import numpy as np
import matplotlib.pyplot as plt
@unalfaruk
unalfaruk / main.c
Last active April 29, 2022 19:04
Convolution on ARM Processor
View main.c
#include "stm32wlxx_hal.h"
#include "arm_math.h" // ARM::CMSIS:DSP
#define SIG_LENGTH 250
#define IMP_RSP_LEN 29
#define NUM_TAPS 29
#define BLOCK_SIZE 32
uint32_t freq; //it is just for trace.. not related to DSP