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
| # Fractional Delay Filter using the Farrow Structure | |
| # https://wirelesspi.com/fractional-delay-filters-using-the-farrow-structure/ | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| if __name__ == "__main__": | |
| # Fixed Coefficients of the Farrow structure for a cubic interpolator | |
| b3 = np.array([-1/6, 1/2,-1/2, 1/6]) | |
| b2 = np.array([ 1/2,-1, 1/2, 0]) |
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 adi | |
| import numpy as np | |
| from datetime import datetime | |
| # ADALM-PLUTO parameter | |
| sample_rate = 12e6 # 12MHz | |
| bandwidth = 4.2e6 # 4.2MHz | |
| center_freq = 1572.42e6 # 1572.42MHz (GPS L1/CA) | |
| duration = 100e-3 # 100ms | |
| num_samps = duration*sample_rate |
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
| # Conway's Game of Life | |
| import curses | |
| import time | |
| import signal | |
| import sys | |
| from typing import List | |
| Vector = List[str] |
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
| // Reverse polish calculator | |
| #include <ctype.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(int argc, char **argv) { | |
| if(argc == 1) | |
| exit(0); |
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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <readline/readline.h> | |
| #include <unistd.h> | |
| #include <stdbool.h> | |
| #include <sys/wait.h> | |
| #include <signal.h> | |
| typedef struct Vector { |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <fcntl.h> | |
| #define BUF_SIZE 256 | |
| int main(int argc, char **argv) { | |
| pid_t pid; |
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
| rotChar :: Int -> Char -> Char | |
| rotChar n c | |
| | c `elem` ['A'..'Z'] = chr(mod ((ord(c) - ord('A')) + n) 26 + ord('A')) | |
| | c `elem` ['a'..'z'] = chr(mod ((ord(c) - ord('a')) + n) 26 + ord('a')) | |
| | otherwise = c | |
| rot :: Int -> String -> String | |
| rot n s = map (rotChar n) s | |
| main = do |
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
| // extend n bit of x to the left. | |
| // Reference: ハッカーのたのしみ(ISBM978-4-434-04668-1) p.18-19 | |
| int32_t sign_extend(uint8_t x, uint8_t n) | |
| { | |
| return (int32_t) ((x + (1 << n)) & ((1 << n) | ((1 << n) - 1))) - (1 << n); | |
| } |
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
| // リンカ・ローダ実践開発テクニック p.88: pointer.c | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| char s1[] = "This is array."; | |
| char *s2 = "This is pointer."; | |
| int main() { | |
| printf(" s1 = 0x%08lx\n", (unsigned long) s1); |
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
| // リンカ・ローダ実践開発テクニック p.78-80: ardump.c | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <fcntl.h> | |
| #include <unistd.h> | |
| #include <elf.h> | |
| #include <ar.h> | |
| #include <sys/stat.h> |
NewerOlder