Skip to content

Commit

Permalink
gft header fix
Browse files Browse the repository at this point in the history
  • Loading branch information
remnrem committed Oct 13, 2024
1 parent 6ab98fd commit 8d3b865
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dsp/gft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "fftw3.h"
#include <cstdlib>
#include <string>
#include <cstring>
#include <cmath>

#define PI 3.1415926535897931
Expand Down Expand Up @@ -70,7 +70,7 @@ void gft_shift(double *sig, int N, int amount) {
int i,j;

temp = (double *) malloc(N*2*sizeof(double));
memcpy(temp, sig, N*2*sizeof(double));
std::memcpy(temp, sig, N*2*sizeof(double));
for (i=0; i<N; i++) {
j = i - amount;
if (j < 0) j = N-j;
Expand Down Expand Up @@ -187,7 +187,7 @@ double *gft_windows(int N, gft_windowFunction *window){

win = (double *)malloc((N)*sizeof(double)*2);
temp = (double *)malloc((N)*sizeof(double)*2);
memset(win, 0, N*sizeof(double)*2);
std::memset(win, 0, N*sizeof(double)*2);

// For each of the GFT frequency bands. Using a dyadic scale.

Expand Down Expand Up @@ -236,7 +236,7 @@ double *gft_windowsFromPars(int N, gft_windowFunction *window, int *pars){

win = (double *)malloc((N)*sizeof(double)*2);
temp = (double *)malloc((N)*sizeof(double)*2);
memset(win, 0, N*sizeof(double)*2);
std::memset(win, 0, N*sizeof(double)*2);

// For each of the GFT frequency bands. Using a dyadic scale.

Expand Down Expand Up @@ -327,7 +327,7 @@ void gft_1d_shift(double *signal, unsigned int N, unsigned int shiftBy) {
int i,shiftTo;

temp = (double *)malloc(N*2*sizeof(double));
memcpy(temp,signal,N*2*sizeof(double));
std::memcpy(temp,signal,N*2*sizeof(double));
for (i = 0; i < N; i++) {
shiftTo = i+shiftBy;
if (shiftTo >= N) shiftTo -= N;
Expand Down

0 comments on commit 8d3b865

Please sign in to comment.