allocate_window

Digital Signal Processing Library

Voice Lab

Program name: allocate_window

Language: C

In file: window_lib.c

Objective: Allocate memory for an INT window of window_size size

Usage: void allocate_window(int **window, int window_size);

Parameters:

  • window - The pointer to the 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 data)

User Comments

Code:

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