일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- Mac
- DB
- Database
- docker
- PostgreSQL
- pytorch
- format
- AI
- judge
- CUDA
- Linux
- TORCH
- Python
- Container
- LLM
- GitLab
- git
- numpy
- enV
- Paper
- evaluation
- pandas
- file
- Flask
- Windows
- Package
- Laravel
- Converting
- list
- KAKAO
- Today
- Total
목록numpy (3)
Daily Develope
연산ㅇ 곱셈multiply: a배열과 b배열의 합성곱 (a * b 와 동일)numpy.multiply(a, b)dot: a배열과 b배열의 스칼라곱numpy.dot(a, b)ㅇ absolute: 복소수(a+ib)의 값을 가지는 배열 ary에 대해 절대값(root(a^2 + b^2))의 값을 가지는 배열로 반환numpy.absolute(ary)소수점 제어ㅇ 올림numpy.ceil(value)ㅇ 내림numpy.floor(value)ㅇ 반올림numpy.round(value, point)ㅇ 버림numpy.trunc(value)배열ㅇ 생성- arrange: [start, end] 구간 내 step 간격의 값을 가지는 배열 생성 (default, step = 1)numpy.arrange(start, end, step..
ㅇ 사용 라이브러리 - numpy : pcm파일 로딩 - librosa : pcm파일을 wav형태로 변환 - matplotlib : 파형 출력 ㅇ 코드 import numpy as np import librosa as lr import matplotlib.pyplot as plt ### Load File target = "pcm파일경로" f=open(target, 'rb') buf = bytearray(f.read()) pcm_data = np.frombuffer(buf, dtype = 'int16')# bit 수에 맞게 입력 wav_data = lr.util.buf_to_float(x=pcm_data, n_bytes=2) ### Draw Graph x_axis = [i/8000 if i>0 else i..
PCM 파일 통합(합치기) : PCM은 파일의 시작에 소리 정보를 담고있는 header가 존재하지 않기 때문에, raw 데이터(Byte Code)를 그대로 읽어서 합치면된다. targetList = ["{대상파일1_경로}", "{대상파일2_경로}"] destinationPath = "{생성파일경로}" buf = bytearray() for file in targetList: f = open(file, 'rb') buf += f.read() f.close() wf = open(destinationPath, 'wb') wf.write(buf) wf.close() PCM 에서 WAV 로의 변환 : PCM 데이터를 WAV로 변환하려는 경우 WAV 파일이 어떻게 쓰였는지 나타내는 He..