allocate_d_window

Signal Processing Library

Program name: allocate_d_window

Language: C

In file: window_lib.c

Objective: Allocate memory for a double window of window_size size

Usage: void allocate_d_window(double **d_window, int window_size);

Parameters:

  • d_window - The pointer to the double window
  • window_size - The size of the window
Return value:
  • Null

Mathematical Description:

Comments: Routine is used to allocate memory for a pointer to point to a window (array of double data)

User Comments

Code:

void allocate_d_window(double **d_window, int window_size)
{
(*d_window) = malloc(window_size * sizeof(double));
if((*d_window) == NULL) {
fprintf(stderr, "Error allocating memory for windows (allocate_d_window)\n");
exit(1);
}
return;
}